~sircmpwn/wersh

ref: bcc3fbaf8d1e19c262290916967a524cb2111d37 wersh/example/index.html.sh -rw-r--r-- 797 bytes
bcc3fbafDrew DeVault Initial commit 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function content() {
    cat <<EOF | hoedown
# wersh

Static site generation with POSIX shell scripts, loosely inspired by
[werc](http://werc.cat-v.org).

This page is a shell script: [example/index.html.sh](/index.html.sh). Files
ending with *.sh are sourced and their stdout is written to the corresponding output file.

## Pages

Since it's a shell script, you can do pretty much anything you want. This list
of pages is dynamically generated:

EOF
    for page in $pages
    do
        echo "* [$(page_title "$page")](${page%%.sh})" | hoedown
    done
    cat <<EOF | hoedown

## Static content

Files that don't end in *.sh are automatically copied into the output
directory, like this one:

![](/images/mio.png)
EOF
}

. _templates/layout.html.sh
cp index.html.sh "$outputdir"/index.html.sh