aboutsummaryrefslogtreecommitdiff
path: root/sort.sh
diff options
context:
space:
mode:
authorhitlerrip <git@hitler.rip>2025-07-29 17:46:12 +0200
committerhitlerrip <git@hitler.rip>2025-07-29 17:46:12 +0200
commit2a51b9df1e2f56cb885f1db731cfa70dd05da528 (patch)
treebb83ae790a3290b9d69581eac285c1636c068558 /sort.sh
parentd48ea3fff0f7a08e9acf2be7b11a58e063498bf8 (diff)
downloadwebsite-2a51b9df1e2f56cb885f1db731cfa70dd05da528.tar.gz
website-2a51b9df1e2f56cb885f1db731cfa70dd05da528.tar.bz2
website-2a51b9df1e2f56cb885f1db731cfa70dd05da528.zip
article sorting
added (somewhat) proper article sorting to the build script
Diffstat (limited to 'sort.sh')
-rwxr-xr-xsort.sh59
1 files changed, 0 insertions, 59 deletions
diff --git a/sort.sh b/sort.sh
deleted file mode 100755
index 10d64a1..0000000
--- a/sort.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash
-
-# hitler.rip
-# temporary script that implements sorting articles by date
-# © 2025 hitler.rip <git@hitler.rip>
-# licensed under AGPLv3-or-later; see licenses/code.md for more information
-
-declare -A articlearr
-declare -a workingarr
-declare -A thebestarr
-
-cd ./src/articles/
-
-echo "[test] SECTION - DETERMINE DATE"
-
-for i in *.md; do
-
- echo "[test] reading: $i"
-
- filename=$( echo "$i" | rev | cut -c4- | rev )
-
- if [ "$filename" != "index" ]; then
-
- export WEBMETA_DATE=""
-
- if [ -e "$filename.meta" ]; then
- echo "[test] running script: $filename.meta"
- source ./"$filename".meta
- fi
-
- if [ "$WEBMETA_DATE" == "" ]; then
- export WEBMETA_DATE="2001-09-11*"
- fi
-
- articlearr["$filename"]="$WEBMETA_DATE"
-
- fi
-
-done
-
-echo "[test] SECTION - SORT"
-
-workingarr=($( sort -nr < <(printf '%s\n' "${articlearr[@]}") ))
-
-for date in "${workingarr[@]}"; do
-
- for key in "${!articlearr[@]}"; do
- if [ "${articlearr[$key]}" == "$date" ]; then
- echo "$date matches $key"
- thebestarr["$date"]="$key"
- fi
- done
-
-done
-
-echo "[test] SECTION - GENERATE"
-
-# ...
-