summaryrefslogtreecommitdiff
path: root/article/entry
blob: 8b218319acfe2d1f57cc25a8d186d4adecb0027d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
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>"
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