From cc5666142a009468b5042e7c1786d3a1ecb0a729 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Fri, 20 May 2022 05:43:15 +0000 Subject: [PATCH] stuff --- .gitignore | 23 ---------------------- 20220518.md | 5 +++++ 20220519.md | 5 +++++ README.md | 4 +++- index.tmpl.html | 8 ++++++++ make.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 72 insertions(+), 24 deletions(-) delete mode 100644 .gitignore create mode 100644 20220518.md create mode 100644 20220519.md create mode 100644 index.tmpl.html create mode 100755 make.sh diff --git a/.gitignore b/.gitignore deleted file mode 100644 index adf8f72..0000000 --- a/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# ---> Go -# If you prefer the allow list template instead of the deny list, see community template: -# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore -# -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -# Go workspace file -go.work - diff --git a/20220518.md b/20220518.md new file mode 100644 index 0000000..02b8f2b --- /dev/null +++ b/20220518.md @@ -0,0 +1,5 @@ +pubdate: Thu May 19 16:02:51 UTC 2022 +title: on the blue face +slug: blueface + +_TODO_ diff --git a/20220519.md b/20220519.md new file mode 100644 index 0000000..99f4708 --- /dev/null +++ b/20220519.md @@ -0,0 +1,5 @@ +pubdate: Thu May 18 13:43:31 UTC 2022 +title: new blog +slug: newblog + +_TODO_ diff --git a/README.md b/README.md index 07a1afd..2137705 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # blog -the web log of vilmibm \ No newline at end of file +the web log of vilmibm + +WIP diff --git a/index.tmpl.html b/index.tmpl.html new file mode 100644 index 0000000..d41e395 --- /dev/null +++ b/index.tmpl.html @@ -0,0 +1,8 @@ + + + + the web log of vilmibm + + + + diff --git a/make.sh b/make.sh new file mode 100755 index 0000000..cfd6136 --- /dev/null +++ b/make.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +set -e + +pd=/usr/bin/pandoc +g=/bin/grep +postDir=/home/vilmibm/blog + +function makeHTML() { + htmlDir=/home/vilmibm/public_html/blog + htmlIndexTmpl=/home/vilmibm/blog/index.tmpl.html + htmlIndex=/home/vilmibm/public_html/blog/index.html + + + if [ -e "${htmlIndex}" ] + then + cp $htmlIndex "${htmlIndex}.bak" + fi + + cp $htmlIndexTmpl $htmlIndex + + cd $postDir > /dev/null + for p in $(ls *.md) + do + pubdate=$($g "pubdate:" $p | sed 's/pubdate://') + title=$($g "title:" $p | sed 's/title://') + slug=$($g "slug:" $p | sed 's/slug://' | tr -d \[:blank:\]) + if [ -z "$pubdate" ] || [ -z "$title" ] + then + echo "warning: missing at least one of: pubdate, slug, title in ${p}" + else + echo "

${title}

" >> $htmlIndex + echo "${pubdate}" >> $htmlIndex + echo "
" >> $htmlIndex + $g -v "pubdate:" $p | $g -v "title:" | $g -v "slug:" |$pd -fmarkdown -thtml >> $htmlIndex + echo "
" >> $htmlIndex + fi + done + + echo "" >> $htmlIndex +} + +#function makeGopher() { +# # TODO +#} +# +#function makeGemini() { +# # TODO +#} + +makeHTML