trunk
vilmibm 2022-05-20 05:43:15 +00:00
parent 7bcf375102
commit cc5666142a
6 changed files with 72 additions and 24 deletions

23
.gitignore vendored
View File

@ -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

5
20220518.md 100644
View File

@ -0,0 +1,5 @@
pubdate: Thu May 19 16:02:51 UTC 2022
title: on the blue face
slug: blueface
_TODO_

5
20220519.md 100644
View File

@ -0,0 +1,5 @@
pubdate: Thu May 18 13:43:31 UTC 2022
title: new blog
slug: newblog
_TODO_

View File

@ -1,3 +1,5 @@
# blog
the web log of vilmibm
the web log of vilmibm
WIP

8
index.tmpl.html 100644
View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<title>the web log of vilmibm</title>
<meta charset="UTF-8">
<!-- TODO css -->
</head>
<body>

51
make.sh 100755
View File

@ -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 "<h2 class=\"title\">${title}</h2>" >> $htmlIndex
echo "<a class=\"pubdate\" name=\"${slug}\" href=\"https://tilde.town/~vilmibm/blog#${slug}\">${pubdate}</a>" >> $htmlIndex
echo "<div class=\"post\">" >> $htmlIndex
$g -v "pubdate:" $p | $g -v "title:" | $g -v "slug:" |$pd -fmarkdown -thtml >> $htmlIndex
echo "</div>" >> $htmlIndex
fi
done
echo "</body></html>" >> $htmlIndex
}
#function makeGopher() {
# # TODO
#}
#
#function makeGemini() {
# # TODO
#}
makeHTML