aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build29
-rwxr-xr-xscripts/genposts9
-rwxr-xr-xscripts/meta22
-rwxr-xr-xscripts/postinfo24
-rwxr-xr-xscripts/posts16
-rwxr-xr-xscripts/tags10
6 files changed, 0 insertions, 110 deletions
diff --git a/scripts/build b/scripts/build
deleted file mode 100755
index 0a5e246..0000000
--- a/scripts/build
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-web_root=/var/www/blog
-
-cd $(dirname $0)
-
-echo "-> generating posts.json..."
-./genposts
-
-cd ..
-
-echo "-> building static files..."
-npx next build
-
-echo "-> exporting static files..."
-npx next export
-
-echo "-> generating atom.xml..."
-./rss/genrss
-
-echo "-> cleaning $web_root..."
-rm -rf $web_root/*
-
-echo "-> moving static files to $web_root..."
-cp -rv out/* $web_root
-
-echo "-> cleaning out directory..."
-rm -rfv out
-
diff --git a/scripts/genposts b/scripts/genposts
deleted file mode 100755
index 22459fb..0000000
--- a/scripts/genposts
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-cd $(dirname $0)
-
-./posts |\
- jq ".posts |= sort_by(.date)" |\
- jq -c \
- > ../public/posts.json
-
diff --git a/scripts/meta b/scripts/meta
deleted file mode 100755
index f7a3f84..0000000
--- a/scripts/meta
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-tag_name=$1
-filename=$2
-
-output=$(grep -Poh "^\[meta\]:\s+<$tag_name>\s+\(\K(.+)(?=\)$)" $filename)
-
-if [ "$tag_name" = "tags" ]; then
- echo $output |\
- sed "s/,\s*/\n/g" |\
- sed -z '$ s/\n$//' |\
- jq --raw-input --slurp 'split("\n")'
-else
- if [ "$output" = "" ]; then
- echo "" | jq --raw-input
- else
- echo $output |\
- sed -z '$ s/\n$//' |\
- jq --raw-input
- fi
-fi
-
diff --git a/scripts/postinfo b/scripts/postinfo
deleted file mode 100755
index d6da015..0000000
--- a/scripts/postinfo
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-cd "$(dirname $0)"
-
-filename=$1
-
-jq -n \
- --argjson title "$(./meta title $filename)" \
- --argjson subtitle "$(./meta subtitle $filename)" \
- --argjson author "$(./meta author $filename)" \
- --argjson date "$(./meta date $filename)" \
- --argjson tags "$(./meta tags $filename)" \
- --argjson cover "$(./meta cover $filename)" \
- --argjson id "$(basename $filename .md | jq --raw-input)" \
-'{
- "title": $title,
- "subtitle": $subtitle,
- "author": $author,
- "date": $date,
- "tags": $tags,
- "cover": $cover,
- "id": $id
-}'
-
diff --git a/scripts/posts b/scripts/posts
deleted file mode 100755
index 12900e1..0000000
--- a/scripts/posts
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-postsmeta=$( find ../posts \
- -name "*.md" \
- -type f \
- -exec ./postinfo {} \; |\
- jq -s '.')
-
-jq -n \
- --argjson valid_tags "$(./tags)" \
- --argjson posts "$postsmeta" \
-'{
- "valid_tags": $valid_tags,
- "posts": $posts
-}'
-
diff --git a/scripts/tags b/scripts/tags
deleted file mode 100755
index c0e784b..0000000
--- a/scripts/tags
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-grep -Proh \
- "^\[meta\]:\s+<tags>\s+\(\K(.+)(?=\)$)" ../posts |\
- sed "s/,\s*/\n/g" |\
- sort |\
- uniq |\
- sed -z '$ s/\n$//' |\
- jq --raw-input --slurp 'split("\n")'
-