diff options
| author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2025-05-03 12:38:39 +0200 |
|---|---|---|
| committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2025-06-15 01:30:32 +0200 |
| commit | 83d796eeb1c8db91b8a11f36eb00f91bce8173e0 (patch) | |
| tree | 1a01a7e04b5ea476588497c75c6de54db414d5a4 /build/update-makefile.scm | |
| parent | 48a8a5c2f392dea41bebcbf126cbb3a452e961b3 (diff) | |
| download | haunt-blog-83d796eeb1c8db91b8a11f36eb00f91bce8173e0.tar.gz haunt-blog-83d796eeb1c8db91b8a11f36eb00f91bce8173e0.tar.bz2 haunt-blog-83d796eeb1c8db91b8a11f36eb00f91bce8173e0.zip | |
Move blog posts to the posts/ directory.
We also have two other pages that are not generated from the blog posts
(reply.html and search.html).
It would be nice to be able to move them to markdown as well, but if we do
that it is necessary to differenciate between markdown files used to generate
blog posts, and the ones used to generate these pages.
In addition if the blog posts directory is named markdown, and that we have
other markdown files as well, it become confusing for contributors.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'build/update-makefile.scm')
| -rw-r--r-- | build/update-makefile.scm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/build/update-makefile.scm b/build/update-makefile.scm index 939b87b..4eea4f3 100644 --- a/build/update-makefile.scm +++ b/build/update-makefile.scm @@ -18,11 +18,11 @@ #:use-module (rnrs base)) ;; Input https://blog.replicant.us/2023/12/replicant-37c3/ -;; Ouptut: markdown/2023_12_replicant-37c3.md +;; Ouptut: posts/2023_12_replicant-37c3.md (define-public (html-to-markdown url) """Convert an URL like https://blog.replicant.us/2023/12/replicant-37c3/ to the corresponding markdown file path like - markdown/2023_12_replicant-37c3.md""" + posts/2023_12_replicant-37c3.md""" ;; Output: replicant-37c3 (define page @@ -36,11 +36,11 @@ (define month (list-ref (string-split url #\/) 4)) - (string-append "markdown/" year "_" month "_" page ".md")) + (string-append "posts/" year "_" month "_" page ".md")) (define-public (get-markdown-article-lines port) """Generate the list of lines like - '\tmarkdown/2023_12_replicant-37c3.md \\' from links.txt.""" + '\tposts/2023_12_replicant-37c3.md \\' from links.txt.""" (define lines '()) (define (func port lines) (let ((line (get-line port))) @@ -57,7 +57,7 @@ (define-public (generate-new-makefile generated-text) """Generate a Makefile with the generated-text instead to replace the - 'MARKDOWN_ARTICLES = [...]' part of the Makefile.""" + 'POSTS = [...]' part of the Makefile.""" (define lines '()) (define (process-makefile port) (define print? #t) @@ -66,7 +66,7 @@ (if (eof-object? line) (reverse lines) ((lambda _ - (if (string=? line "MARKDOWN_ARTICLES = \\") + (if (string=? line "POSTS = \\") (set! print? #f)) (if print? (set! lines (cons (string-append line "\n") lines))) @@ -81,7 +81,7 @@ (define-public new-markdown-articles-text (generate-new-makefile (string-append - "MARKDOWN_ARTICLES = \\\n" + "POSTS = \\\n" (string-join (call-with-input-file "links.txt" get-markdown-article-lines) "") @@ -103,7 +103,7 @@ (assert (string=? (html-to-markdown "https://blog.replicant.us/2023/12/replicant-37c3/") - "markdown/2023_12_replicant-37c3.md")))) + "posts/2023_12_replicant-37c3.md")))) (list "get-markdown-article-lines" |
