summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-12-08 12:57:20 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-12-08 12:57:20 +0300
commit4430cd5e78258bf44baa7a09ad4a5afdb3328ca5 (patch)
treef13e1b29d962b59fdc3fe6ebc9f5d00d0bd113d6
parent9ff2de24d95bccac35bf5eba1225fa24493599a4 (diff)
downloadvsvs-4430cd5e78258bf44baa7a09ad4a5afdb3328ca5.tar
vsvs-4430cd5e78258bf44baa7a09ad4a5afdb3328ca5.tar.xz
vsvs-4430cd5e78258bf44baa7a09ad4a5afdb3328ca5.zip
.
-rw-r--r--article/entry5
-rw-r--r--article/template15
2 files changed, 11 insertions, 9 deletions
diff --git a/article/entry b/article/entry
index 231da40..9bccfbd 100644
--- a/article/entry
+++ b/article/entry
@@ -3,7 +3,10 @@ after () { test -z "${2##*$1*}" && echo -n "${2#*$1}"; }
if test -z "$1"
then
# TODO: deep dark magic of constructing a list of articles
- echo "<html><head><title>Artciles</title></head><body><p>Artciles</p></body></html>"
+ cd list
+ export articles="$(vsvs-archive)"
+ cd ..
+ vsvs-extract 'test "$key" == "list" && echo "$value"' "template" | shelter
elif test -e "list/${1%%/*}"
then
if test -n "$(after / $1)"
diff --git a/article/template b/article/template
index fec42d7..ee49943 100644
--- a/article/template
+++ b/article/template
@@ -1,12 +1,11 @@
list
- page <html>
- <head><title>List of articles</title></head>
- <body>
- <p>Here are some articles for you:</p>
- <ul>$list</ul>
- </body>
- </html>
- item <li><a href=\"$id\">$title</a></li>
+ <html>
+ <head><title>List of articles</title></head>
+ <body>
+ <p>Here are some articles for you:</p>
+ <ul>$(echo "$articles" | vsvs-parse 'echo "<li><a href=\"$key\">$title</a></li>"')</ul>
+ </body>
+ </html>
page <html>
<head><title>$title</title></head>
<body>$content</body>