Last-modified .mdwn header
This commit is contained in:
parent
e13356da0f
commit
88c1d0d626
|
@ -46,3 +46,7 @@ address a:before {
|
|||
padding: 0.5em;
|
||||
}
|
||||
|
||||
#timestamp {
|
||||
font-size: small;
|
||||
text-indent: inherit;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
Title: The Setup / Neale Pickett
|
||||
Time-stamp: <2016-06-03 10:47:45 neale>
|
||||
|
||||
After reading [Russ Cox's setup](http://russ.cox.usesthis.com/)
|
||||
I thought it might be interesting to write up my own.
|
||||
|
||||
29 December, 2015
|
||||
|
||||
|
||||
Who are you, and what do you do?
|
||||
|
|
|
@ -18,12 +18,15 @@ while IFS=': ' read field value; do
|
|||
Header)
|
||||
printf " %s\n" "$value"
|
||||
;;
|
||||
Time-stamp)
|
||||
timestamp=$(printf "%s" "$value" | awk -F '[< ]' '{print $2}')
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
tmpl=$(dirname $0)
|
||||
|
||||
cat <<EOD
|
||||
cat <<EOF
|
||||
<title>$title</title>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="stylesheet" type="text/css" href="/neale/css/font-awesome.min.css">
|
||||
|
@ -33,11 +36,17 @@ cat <<EOD
|
|||
</head>
|
||||
<body>
|
||||
<h1>$title</h1>
|
||||
EOD
|
||||
EOF
|
||||
cat $tmpl/head.tmpl
|
||||
pandoc -f markdown -t html5
|
||||
|
||||
[ -n "$timestamp" ] && cat <<EOF
|
||||
<p id="timestamp">Last modified: $timestamp</p>
|
||||
EOF
|
||||
|
||||
cat $tmpl/foot.tmpl
|
||||
cat <<EOD
|
||||
|
||||
cat <<EOF
|
||||
</body>
|
||||
</html>
|
||||
EOD
|
||||
EOF
|
||||
|
|
Loading…
Reference in New Issue