aboutsummaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rw-r--r--make51
1 files changed, 51 insertions, 0 deletions
diff --git a/make b/make
new file mode 100644
index 0000000..d35059c
--- /dev/null
+++ b/make
@@ -0,0 +1,51 @@
+#!/bin/sh -eu
+
+Content() {
+number=1
+amount=${1:-100}
+
+rm --recursive --force content/markdown
+mkdir --parents content/markdown
+
+while [ $number -le "$amount" ]; do
+date=$(date --iso-8601=ns)
+file="content/markdown/$number.md"
+printf \
+'+++
+date = "%s"
+lastmod = "%s"
++++
+
+Post Number %s
+' \
+"$date" \
+"$date" \
+"$number" \
+> "$file"
+printf 'Writing.. %s\n' "$file"
+number=$((number+1))
+done
+}
+
+Hugo() {
+ sh "$0" Config
+ hugo --debug
+ rm --force .hugo_build.lock
+}
+
+Config() {
+ set -x
+ yj -yj -i < config.yaml > config.json
+ yj -yt -i < config.yaml > config.toml
+}
+
+Clean() {
+ set -x
+ rm --recursive --force public
+}
+
+Server() {
+ caddy file-server --listen :1313 --root public
+}
+
+"$@"