aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhitlerrip <git@hitler.rip>2025-08-04 16:45:37 +0200
committerhitlerrip <git@hitler.rip>2025-08-04 16:45:37 +0200
commit164a2ebf657ea030268d523a4acb000897fca817 (patch)
tree3164761b69efa2c9f1a80cf8b2382f4e265a6e63
parent95203c20e0e71e8d30ad87df3595711127af0269 (diff)
downloadwebsite-164a2ebf657ea030268d523a4acb000897fca817.tar.gz
website-164a2ebf657ea030268d523a4acb000897fca817.tar.bz2
website-164a2ebf657ea030268d523a4acb000897fca817.zip
primitive links
added primitive link generation this needs to re-run the script to create links, there is no such thing as fetching links from a database. i am unsure if i want this added...
-rwxr-xr-xbuild.sh39
-rw-r--r--lnk/test.meta1
2 files changed, 40 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index 1f5c57f..39840de 100755
--- a/build.sh
+++ b/build.sh
@@ -21,6 +21,7 @@ mkdir -p ./src/articles/
mkdir -p ./tmp/articles/
mkdir -p ./web/articles/
mkdir -p ./web/licenses/
+mkdir -p ./web/links/
mkdir -p ./dir/
touch ./con/header.html
@@ -243,6 +244,44 @@ cat ./con/rss-header.xml \
./con/rss-footer.xml \
> ./web/articles/feed.xml
+echo "[build] creating links..."
+
+tee ./tmp/temp-content-links-site.html > /dev/null << EOF
+ <h1>Links</h1>
+ <p>Dynamic Link generation is currently not possible.</p>
+EOF
+cat ./con/header.html \
+ ./tmp/temp-content-links-site.html \
+ ./con/footer.html \
+ > ./web/links/index.html
+
+cd ./lnk/
+for i in *.meta; do
+
+ echo "[build] linking to: $i"
+ filename=$( echo "$i" | rev | cut -c6- | rev )
+ content=$( cat "$i" )
+
+ mkdir -p ../web/links/"$filename"/
+ tee ../web/links/"$filename"/index.html > /dev/null << EOF
+ <html>
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel="stylesheet" href="/style.css">
+ <link rel="icon" type="image/x-icon" href="/icon.png">
+ <title>$filename</title>
+ <meta http-equiv="refresh" content="0; url=$content">
+ </head>
+ <body>
+ <p><a href="$content">redirect...</a></p>
+ </body>
+ </html>
+EOF
+
+done
+cd ..
+
echo "[build] copying static files..."
cp ./con/style.css ./web/style.css
cp ./con/icon.png ./web/icon.png
diff --git a/lnk/test.meta b/lnk/test.meta
new file mode 100644
index 0000000..fa910e5
--- /dev/null
+++ b/lnk/test.meta
@@ -0,0 +1 @@
+https://duckduckgo.com