added last modified dates (for autogenerated pages, it's last generated date)
This commit is contained in:
parent
78afbc91d0
commit
702564e31e
|
@ -1,5 +1,5 @@
|
|||
trigger_secret.txt
|
||||
src/wiki
|
||||
*.html
|
||||
dist/
|
||||
vendor/
|
||||
signup/
|
||||
|
|
24
build.sh
24
build.sh
|
@ -3,6 +3,14 @@
|
|||
#umask 0113
|
||||
dir="$(echo "$0"|sed 's|/[^/]\+$||')"
|
||||
if [ -d "$dir" ];then cd "$dir";fi
|
||||
header="inc/header.html"
|
||||
footer_start="inc/footer_start.html"
|
||||
footer_end="inc/footer_end.html"
|
||||
|
||||
mdate(){
|
||||
date="$(date -u -d "@$(stat -c %Y "$1" )" "+%Y-%m-%dT%H:%MZ")"
|
||||
printf "%s<time datetime=%s>%s</time>\n" "${2:-Last Modified: }" "$date" "$(echo "$date"|sed 's/T/ /;s/Z/ UTC/')"
|
||||
}
|
||||
|
||||
# no_ext removes the trailing .html,
|
||||
# useful to tidy the URL, if you've set up your server to work with that in mind
|
||||
|
@ -54,7 +62,9 @@ for path in . ./wiki;do
|
|||
else
|
||||
cat
|
||||
fi |
|
||||
cat inc/header.html - inc/footer.html >"dist/$dir/$filename.html"
|
||||
cat "$header" - "$footer_start" >"dist/$dir/$filename.html"
|
||||
mdate "src/$dir/$filename.md"|
|
||||
cat - "$footer_end" >>"dist/$dir/$filename.html"
|
||||
# ' \;
|
||||
done
|
||||
|
||||
|
@ -62,12 +72,16 @@ done
|
|||
|
||||
echo "creating user list page.."
|
||||
./users.sh|markdown|
|
||||
cat inc/header.html - inc/footer.html > dist/users.html
|
||||
cat "$header" - "$footer_start" > dist/users.html
|
||||
mdate "dist/users.html" "Last Generated: "|
|
||||
cat - "$footer_end" >> dist/users.html
|
||||
|
||||
echo "creating index page.."
|
||||
./users.sh|
|
||||
cat src/index.md -|markdown|
|
||||
cat inc/header.html - inc/footer.html > dist/index.html
|
||||
cat "$header" - "$footer_start" > dist/index.html
|
||||
mdate "dist/index.html" "Last Generated: "|
|
||||
cat - "$footer_end" >> dist/index.html
|
||||
|
||||
echo "creating index page for wiki..."
|
||||
markdown "$tmpindex" |
|
||||
|
@ -77,7 +91,9 @@ markdown "$tmpindex" |
|
|||
else
|
||||
cat
|
||||
fi |
|
||||
cat inc/header.html - inc/footer.html > dist/wiki/index.html
|
||||
cat "$header" - "$footer_start" > dist/wiki/index.html
|
||||
mdate "dist/wiki/index.html" "Last Generated: "|
|
||||
cat - "$footer_end" >> dist/wiki/index.html
|
||||
rm "$tmpindex"
|
||||
|
||||
echo "all done!"
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
</main>
|
||||
<footer>
|
||||
</footer>
|
||||
</html>
|
|
@ -0,0 +1,2 @@
|
|||
</main>
|
||||
<footer>
|
2
src/wiki
2
src/wiki
|
@ -1 +1 @@
|
|||
Subproject commit 8851ad3fa0f12ab66d495302c1d30977bfc1bf01
|
||||
Subproject commit b27cae389b469b4bd2c6e0abbd2e839fc8f9e758
|
Loading…
Reference in New Issue