]> Git in Space - website/commitdiff
Add extra ssg functions locally rather than hiding them on my local
authorMira Ayre <mi@boxin.space>
Thu, 17 Jun 2021 23:02:51 +0000 (00:02 +0100)
committerMira Ayre <mi@boxin.space>
Sat, 19 Jun 2021 16:57:06 +0000 (17:57 +0100)
machine

ssg/blog.sh [new file with mode: 0644]
ssg/git.sh [new file with mode: 0644]

diff --git a/ssg/blog.sh b/ssg/blog.sh
new file mode 100644 (file)
index 0000000..8b8a4d9
--- /dev/null
@@ -0,0 +1,12 @@
+function read-time() {
+       echo "$(($(wc -l < $THISFILE) / 12)) minute read"
+}
+
+function t() {
+       text="### $@ ###"
+       pad=$(( ( ( 80 - ${#text} ) / 2 ) - 1 ))
+       echo "text '$text' has length '${#text}' and so pad '$pad'" > /dev/stderr
+       printf '<a href="/">~</a>'
+       printf ' %.0s' $(seq 1 $pad)
+       printf "%s\n" "<b>$text</b>"
+}
diff --git a/ssg/git.sh b/ssg/git.sh
new file mode 100644 (file)
index 0000000..8394b79
--- /dev/null
@@ -0,0 +1,4 @@
+function git-listing() {
+       git list | sed 's/^\([^\t]\)/#\1/;s/^\t//' | fold -sw 72 \
+               | sed 's/^/\t/;s/^\t#//'
+}