From 52e9c3aeea18d5750fea8704711a113adae93903 Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 12 Jun 2023 03:57:18 +0100 Subject: create example site where every page is executed to generate itself --- example/entries/entries.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 example/entries/entries.sh (limited to 'example/entries/entries.sh') diff --git a/example/entries/entries.sh b/example/entries/entries.sh new file mode 100755 index 0000000..0479d96 --- /dev/null +++ b/example/entries/entries.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +# add a special header to all entries +cat << EOF + + + + + $1 + + +

my blog

+EOF + +# make this page be the index if it is called with no arguments +[ -z "$1" ] && { + cat << EOF +

blog entries

+ +EOF + +} || { + # convert the markdown page to html text + md2html $1 + + # add a back button + cat << EOF +go back to list +EOF +} + +# and a footer +cat << EOF + + +EOF + -- cgit v1.2.1