From: Lukas Krickl Date: Sun, 22 Jun 2025 06:44:13 +0000 (+0200) Subject: Added simple blog engine and a md2html converter script X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=e03e06fb7192279e05325db6882009b7294f60b3;p=website%2F.git Added simple blog engine and a md2html converter script --- diff --git a/.gitignore b/.gitignore index f40fbd8..19c49cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ -_site -.sass-cache -.jekyll-cache -.jekyll-metadata -vendor +blog/*.html +atom.xml diff --git a/README.md b/README.md index 42aa374..c3182e4 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,13 @@ ## Usage +To convert all blog posts from markdown to html run the following command. +This will also create an atom feed. + +```bash +./md2html.sh +``` + ## License This program is distributed under the terms of the MIT License. diff --git a/blog.html b/blog.html new file mode 100644 index 0000000..c93f0ca --- /dev/null +++ b/blog.html @@ -0,0 +1,26 @@ + + + + + krickl.dev + + + + + + + +

krickl.dev

+ +
+

Posts

+ +
+ + Contact + + + diff --git a/blog/2025-06-22-hello-blog.md b/blog/2025-06-22-hello-blog.md new file mode 100644 index 0000000..f52fb60 --- /dev/null +++ b/blog/2025-06-22-hello-blog.md @@ -0,0 +1,11 @@ +# Hello Blog + +## 2025-06-22 + +This is my first post on my new blog. +The blog engine itself is rather simple. I use pandoc to convert markdown files to basic html. +I also generate a simple atom feed with all entries. + +This blog will soon serve as a devlog for my gameboy game! + +Hope to be posting more soon :) diff --git a/contact.html b/contact.html new file mode 100644 index 0000000..65beeb0 --- /dev/null +++ b/contact.html @@ -0,0 +1,13 @@ + + + + +

Contact

+ + + + diff --git a/index.html b/index.html index e728812..b1e6744 100644 --- a/index.html +++ b/index.html @@ -14,34 +14,37 @@

krickl.dev

-

ulas

+

Blog

+
+ +
+

Projects

+ +

ulas

Ulas is a assembler for the sm83 cpu. It currently supports direct assembly without a linking step and will in the future also offer a disassembler as well as a debugger interface.

-
-
-

gbrg

+

gbrg

Gbrg is a turn-based rpg for the gameboy written in ulas. It serves as a demo project for the assembler.

+ +
+

Links

+ +
-

Links

- -

Contact

- + Contact diff --git a/md2html.sh b/md2html.sh new file mode 100755 index 0000000..0173b92 --- /dev/null +++ b/md2html.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +set -e + +# This script takes all pages in ./blog/*.md and converts +# it to markdown using pandoc +# It also creates an atom feed + +# convert blog to html + +cd ./blog +for f in *.md; do + BASENAME=$(basename $f ".md") + pandoc -f markdown $f > "./$BASENAME.html" +done + +# create atom feed + +write_atom() { + printf "$1\n" >> ./atom.xml +} + +printf '' > ./atom.xml + +DATE=$(date) +URL="https://krickl.dev" +AUTHOR="Lukas Krickl" + +write_atom '' +write_atom '' + +write_atom " $URL" +write_atom " " +write_atom " " +write_atom " $URL" +write_atom " $DATE" +for f in *.md; do + BASENAME=$(basename $f ".md") + UPDATED=$(date -r $f) + write_atom ' ' + write_atom " $URL/blog/$BASENAME.html" + write_atom " " + write_atom " $BASENAME" + write_atom " $AUTHOR" + write_atom " $UPDATED" + write_atom ' ' +done + +write_atom ''