summaryrefslogtreecommitdiff
path: root/article
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-12-07 18:24:01 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-12-07 18:24:01 +0300
commit816d965b42588ffbf8b07e4026c039c8c86dcad9 (patch)
tree45e66758430227a4b2d01214602f30046958254c /article
parent30cff0f11149ea2a85b025d143aa4a46369c87f0 (diff)
downloadvsvs-816d965b42588ffbf8b07e4026c039c8c86dcad9.tar
vsvs-816d965b42588ffbf8b07e4026c039c8c86dcad9.tar.xz
vsvs-816d965b42588ffbf8b07e4026c039c8c86dcad9.zip
.
Diffstat (limited to 'article')
-rw-r--r--article/entry17
1 files changed, 16 insertions, 1 deletions
diff --git a/article/entry b/article/entry
index c72a79a..3a933a7 100644
--- a/article/entry
+++ b/article/entry
@@ -1,2 +1,17 @@
#!/bin/bash
-cat $base/data/404.html
+after () { test -z "${2##*$1*}" && echo -n "${2#*$1}"; }
+if test -z "$1"
+then
+ # TODO: deep dark magic of constructing a list of articles
+ cat $base/data/404.html
+elif test -e "list/${1%%/*}"
+then
+ if test -n "$(after / $1)"
+ then cat $base/data/404.html
+ else
+ export title="$(vsvs-extract 'echo "$value"' "list/${1%%/*}/title")"
+ export content="$(vsvs-extract 'echo "$value"' "list/${1%%/*}/content")"
+ vsvs-extract 'echo "$value"' "template/page" | shelter
+ fi
+else cat $base/data/404.html
+fi