From 6595cafe41544ab13935d0e2356b101631d0e930 Mon Sep 17 00:00:00 2001 From: Vincent Douillet Date: Mon, 1 Nov 2021 19:03:09 +0100 Subject: add article title in title bar --- Makefile | 26 +++++++++++++++++++------- about.md | 3 --- static/about.md | 3 +++ template/header.html | 2 +- 4 files changed, 23 insertions(+), 11 deletions(-) delete mode 100644 about.md create mode 100644 static/about.md diff --git a/Makefile b/Makefile index 3b4a711..bb52782 100644 --- a/Makefile +++ b/Makefile @@ -3,21 +3,33 @@ MD=markdown_py articles!=ls *.md articles_html = ${articles:.md=.html} -site : index $(articles_html) +site : index about $(articles_html) @echo "done" index : - @echo "Building index" - @cat template/header.html > output/index.html - @echo '' >> output/index.html - @cat template/index.html >> output/index.html - @echo '' >> output/index.html - @cat template/footer.html >> output/index.html + @echo "Building $@" + @cat template/header.html > output/$@.html + @sed -i "s/\$$title/blog\.vdouillet\.fr/g" output/$@.html + @echo '' >> output/$@.html + @cat template/index.html >> output/$@.html + @echo '' >> output/$@.html + @cat template/footer.html >> output/$@.html + +about : + @echo "Building $@" + @cat template/header.html > output/$@.html + @sed -i "s/\$$title/About/g" output/$@.html + @echo '' >> output/$@.html + @$(MD) static/$@.md >> output/$@.html + @echo '' >> output/$@.html + @cat template/footer.html >> output/$@.html # compile each article .md.html: @echo "Processing $<" @cat template/header.html > tmp.html + @ARTICLE_TITLE=`head -n1 $< | cut -d'# ' -f2` ; \ + sed -i "s/\$$title/$$ARTICLE_TITLE/g" tmp.html @echo '
' >> tmp.html @$(MD) $< >> tmp.html @cat template/back.html >> tmp.html diff --git a/about.md b/about.md deleted file mode 100644 index 13c94bc..0000000 --- a/about.md +++ /dev/null @@ -1,3 +0,0 @@ -My name is Vincent, I live in France. I like simple things, (old) computers, nature and music. Here I mostly talk about IT stuff but I may sometimes digress. We can get in touch on [Twitter](https://twitter.com/vdouillet12). - -In order to stay in line with the "simple" value stated above, this blog is completely static. It is generated using [a custom Makefile](//git.vdouillet.fr/blog) and is proudly hosted on [OpenBSD Amsterdam](https://openbsd.amsterdam). On here you will find no JavaScript, no cookies, no trackers. The CSS style sheet is very simple because content formatting relies mostly on HTML tags. This enables this blog to auto-magically adapt to your device size and to be compatible with CLI web browsers. diff --git a/static/about.md b/static/about.md new file mode 100644 index 0000000..13c94bc --- /dev/null +++ b/static/about.md @@ -0,0 +1,3 @@ +My name is Vincent, I live in France. I like simple things, (old) computers, nature and music. Here I mostly talk about IT stuff but I may sometimes digress. We can get in touch on [Twitter](https://twitter.com/vdouillet12). + +In order to stay in line with the "simple" value stated above, this blog is completely static. It is generated using [a custom Makefile](//git.vdouillet.fr/blog) and is proudly hosted on [OpenBSD Amsterdam](https://openbsd.amsterdam). On here you will find no JavaScript, no cookies, no trackers. The CSS style sheet is very simple because content formatting relies mostly on HTML tags. This enables this blog to auto-magically adapt to your device size and to be compatible with CLI web browsers. diff --git a/template/header.html b/template/header.html index 33d468b..9d99415 100644 --- a/template/header.html +++ b/template/header.html @@ -2,7 +2,7 @@ -blog.vdouillet.fr +$title