diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2021-04-12 22:27:30 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2021-04-12 22:27:30 +0200 |
| commit | 804ef9b61eeccfcddba3be249392db0f152a7a66 (patch) | |
| tree | 0bff3af3ad22dbb871b0d4c4bc9defa6168a1359 /website/haunt.scm | |
| parent | website: kickoff: Quote Andy's 2011 message. (diff) | |
website: Summarize blog posts on the overview page.
* website/haunt.scm (summarize-post): New procedure.
(post->sxml): Use it.
* website/posts/kickoff.md: Move "DRAFT" below.
Diffstat (limited to 'website/haunt.scm')
| -rw-r--r-- | website/haunt.scm | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/website/haunt.scm b/website/haunt.scm index c86ed04..a230226 100644 --- a/website/haunt.scm +++ b/website/haunt.scm | |||
| @@ -179,14 +179,20 @@ representation." | |||
| 179 | ;; There's an implicit "/index.html" here. | 179 | ;; There's an implicit "/index.html" here. |
| 180 | "/" (site-post-slug site post)))) | 180 | "/" (site-post-slug site post)))) |
| 181 | 181 | ||
| 182 | (define (summarize-post post uri) | ||
| 183 | (match (post-sxml post) | ||
| 184 | ((('p paragraph ...) _ ...) | ||
| 185 | `((p ,@paragraph) | ||
| 186 | (p (a (@ (href ,uri)) "Continue reading…")))) | ||
| 187 | (body | ||
| 188 | body))) | ||
| 189 | |||
| 182 | (define* (post->sxml post #:key post-uri summarize?) | 190 | (define* (post->sxml post #:key post-uri summarize?) |
| 183 | "Return the SXML for POST." | 191 | "Return the SXML for POST." |
| 184 | (define post-body* | 192 | (define post-body* |
| 185 | ;; (if summarize? | 193 | (if summarize? |
| 186 | ;; (cut summarize-post <> post-uri) | 194 | (cut summarize-post <> post-uri) |
| 187 | ;; post-sxml*) | 195 | post-sxml)) |
| 188 | post-sxml | ||
| 189 | ) | ||
| 190 | 196 | ||
| 191 | `(div (@ (class "post")) | 197 | `(div (@ (class "post")) |
| 192 | (h1 (@ (class "title")) | 198 | (h1 (@ (class "title")) |