From: Lukas Krickl Date: Sun, 29 Jun 2025 07:06:58 +0000 (+0200) Subject: Updated md2html generator X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=refs%2Fheads%2Fmain;p=website%2F.git Updated md2html generator --- diff --git a/README.md b/README.md index 1bf1c14..e1baa5d 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,15 @@ Currently the webserver expects those binaries to be there. Images are stored in `images/`. They are not part of the repository but posts may reference them. +### Posts + +All blog posts should have the following format: + +File name: `yyyy-mm-dd-summary-of-post.md` + +Line 1: Title of post as h1 +Line 2: Date of post (yyyy-mm-dd) as h2 + ## License This program is distributed under the terms of the MIT License. diff --git a/blog/2025-06-22-hello-blog.md b/blog/2025-06-22-hello-blog.md index f52fb60..bde77e3 100644 --- a/blog/2025-06-22-hello-blog.md +++ b/blog/2025-06-22-hello-blog.md @@ -1,5 +1,4 @@ # Hello Blog - ## 2025-06-22 This is my first post on my new blog. diff --git a/blog/2025-06-27-gbrg-movement.md b/blog/2025-06-27-gbrg-movement.md index e8cbbf1..0087223 100644 --- a/blog/2025-06-27-gbrg-movement.md +++ b/blog/2025-06-27-gbrg-movement.md @@ -1,5 +1,4 @@ # gbrg movement - ## 2025-06-27 This is my first post about gbrg, the gameboy rpg I am working on right now. diff --git a/md2html.sh b/md2html.sh index d4bdc68..7789435 100755 --- a/md2html.sh +++ b/md2html.sh @@ -28,6 +28,7 @@ printf '' > ./atom.xml DATE=$(date) URL="https://krickl.dev" AUTHOR="Lukas Krickl" +EMAIL="lukas@krickl.dev" write_atom '' write_atom '' @@ -40,11 +41,15 @@ write_atom " $DATE" for f in *.md; do BASENAME=$(basename $f ".md") UPDATED=$(date -r $f) + CONTENT=$(cat "$f") + TITLE=$(cat "$f" | head -n 1) + write_atom ' ' write_atom " $URL/blog/$BASENAME.html" write_atom " " - write_atom " $BASENAME" - write_atom " $AUTHOR" + write_atom " $TITLE" + write_atom " $CONTENT" + write_atom " $AUTHOR$EMAIL" write_atom " $UPDATED" write_atom ' ' done