Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitfe054ac33b1d28ae16dbae9305651188f0b22608 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-07-20 19:46:45 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-07-20 19:46:45 +0300
Files390118dfa7ea1cd9a0de4e257198c99585e16fde
syndamia.com-fe054ac33b1d28ae16dbae9305651188f0b22608.tar
syndamia.com-fe054ac33b1d28ae16dbae9305651188f0b22608.tar.gz
syndamia.com-fe054ac33b1d28ae16dbae9305651188f0b22608.zip
Parentd54c672035ab29b0d392bd7641c83808945ee21b (diff)
feat(src/ext): Implemented a large part of the awk_edits functionality via dunbar
8 files changed, 142 insertions, 1 deletions
m---------dunbar0
-rw-r--r--ext/attention.awk9
-rw-r--r--ext/heading-anchors.awk11
-rw-r--r--ext/icons.du35
-rw-r--r--ext/meta.awk22
-rw-r--r--ext/pagenav.awk29
-rwxr-xr-xgenerate.sh2
-rw-r--r--src/meta.tsv35
diff --git a/dunbar b/dunbar
-Subproject cbd15add4312e0ef471b1b792387017fc1533e7
+Subproject 3a4b5347b12b97a67da220516ec31a4f8c4716c
diff --git a/ext/attention.awk b/ext/attention.awk
new file mode 100644
index 0000000..9182635
--- /dev/null
+++ b/ext/attention.awk
@@ -0,0 +1,9 @@
+BEGIN {
+ define("question", open_attention("dialog-question.png"))
+ define("warn", open_attention("dialog-warning.png"))
+ define("important", open_attention("dialog-important.png"))
+}
+
+function open_attention(name, image) {
+ return "<p class=\"special-par " name "-par\"><img src=\"/img/" image "\" class=\"special-par-icon borderless unzoomable\" alt=\"" name "\">"
+}
diff --git a/ext/heading-anchors.awk b/ext/heading-anchors.awk
new file mode 100644
index 0000000..42b85a0
--- /dev/null
+++ b/ext/heading-anchors.awk
@@ -0,0 +1,11 @@
+BEGIN {
+ gap = "<div class=\"gap\"></div>" ORS
+ small_gap = "<div class=\"gap-small\"></div>" ORS
+ anchor = ORS "<a class=\"h-anchor\" href=\"#[?header?]\" aria-hidden=\"true\">#</a>"
+
+ define("HEADER2", gap "<h2 id=\"[?header?]\">", "</h2>" anchor)
+ define("HEADER3", small_gap "<h3 id=\"[?header?]\">", "</h3>" anchor)
+ define("HEADER4", small_gap "<h4 id=\"[?header?]\">", "</h4>" anchor)
+ define("HEADER5", small_gap "<h5 id=\"[?header?]\">", "</h5>" anchor)
+ define("HEADER6", small_gap "<h6 id=\"[?header?]\">", "</h6>" anchor)
+}
diff --git a/ext/icons.du b/ext/icons.du
new file mode 100644
index 0000000..4878bc7
--- /dev/null
+++ b/ext/icons.du
@@ -0,0 +1,35 @@
+'define flagdef 'define [$flag] <img src="/img/[$flag].svg" class="flag unzoomable svg" alt="[$alt]" height=18>
+
+ 'define flag gb
+ 'define alt ENG
+ [$flagdef]
+
+ 'define flag bg
+ 'define alt BGN
+ [$flagdef]
+
+'define ftdef 'define [$ft] <span class="file-type-icon">[$char]</span>
+
+ 'define ft ft-photo
+ 'define char &#xeb0a;
+ [$ftdef]
+
+ 'define ft ft-text
+ 'define char &#xeaa2;
+ [$ftdef]
+
+ 'define ft ft-zip
+ 'define char &#xed4e;
+ [$ftdef]
+
+ 'define ft ft-movie
+ 'define char &#xeafa;
+ [$ftdef]
+
+ 'define ft ft-markdown
+ 'define char &#xec41;
+ [$ftdef]
+
+ 'define ft ft-browser
+ 'define char &#xebb7;
+ [$ftdef]
diff --git a/ext/meta.awk b/ext/meta.awk
new file mode 100644
index 0000000..1815cdf
--- /dev/null
+++ b/ext/meta.awk
@@ -0,0 +1,22 @@
+BEGIN {
+ FS="\t"
+ while ((getline < ENVIRON["META"]) > 0) {
+ if ($1 == "") continue
+ meta_title[$1] = $2 " &mdash; Syndamia"
+ meta_description[$1] = $3
+ }
+ FS=" "
+}
+
+FNR == 0 {
+ STD_FILENAME = substr(FILENAME, length(ENVIRON["GEN_DIR"]) + 2)
+
+ if (STD_FILENAME in meta_title) {
+ substitutions["TITLE"] = meta_title[STD_FILENAME]
+ substitutions["DESCRIPTION"] = meta_description[STD_FILENAME]
+ }
+ else {
+ delete substitutions["TITLE"]
+ delete substitutions["DESCRIPTION"]
+ }
+}
diff --git a/ext/pagenav.awk b/ext/pagenav.awk
new file mode 100644
index 0000000..0cd08fc
--- /dev/null
+++ b/ext/pagenav.awk
@@ -0,0 +1,29 @@
+FNR == 0 {
+ # Stats element
+ stats = \
+" <div id=\"pagenav-stats\">" ORS \
+" <strong>Reading: [$expected-reading]</strong> || <strong>Created: [$created]</strong> || <strong>Edited: [$edited]</strong>" ORS \
+" || <a href=\"https://gitlab.com/Syndamia/syndamiadotcom/-/blob/master/src/" STD_FILENAME "\"><strong>GitLab source</strong></a>" ORS \
+" </div>"
+
+ # Breadcrumbs element
+ match(FILEDIR, /(blog|slides|teaching|tutorials|misc)/)
+ foldersLen = split(substr(FILEDIR, RSTART), folders, "/")
+
+ href = ".."
+ breadcrumb = " &raquo; <em>" folders[foldersLen] "</em>"
+ for (i = foldersLen-1; i > 0; i--) {
+ breadcrumb = " &raquo; " "<a href=\"" href "\">" folders[i] "</a>" breadcrumb
+ href = "../" href
+ }
+ breadcrumb = \
+" <div id=\"pagenav-breadcrumb\">" ORS \
+" " breadcrumb ORS \
+" </div>"
+
+ substitutions["pagenav"] = \
+".text <div id=\"pagenav\">" ORS \
+ stats ORS \
+ breadcrumb ORS \
+"</div>"
+}
diff --git a/generate.sh b/generate.sh
index cb3f7c6..3d62dcb 100755
--- a/generate.sh
+++ b/generate.sh
@@ -30,7 +30,7 @@ EOF
rm "$GEN_DIR/$META_FILE" "$GEN_DIR/."*
META="$SRC_DIR/$META_FILE"
- export META
+ export META GEN_DIR
/usr/bin/env dash ./dunbar/dunbar_awk/dunbar.sh html \
-o . \
diff --git a/src/meta.tsv b/src/meta.tsv
new file mode 100644
index 0000000..3ea995e
--- /dev/null
+++ b/src/meta.tsv
@@ -0,0 +1,35 @@
+404.du 404 page not found!
+accessibility.du Accessibility I do want to make sure the content on this website is consumable by people with disabilities, however I also want to fancy features. I'm currently maintaining a balance between the two.
+acknowledgements.du Acknowledgements A list of (mostly) icon projects and blog inspirations
+index.du Home My personal website
+license.du License CC BY-SA for articles, pictures, ... and GNU GPLv3 for source code
+misc.du Miscellaneous Other types of content I've made, including documents, images, videos and web demos.
+privacy.du Privacy policy syndamia.com (and tiny.syndamia.com) offer no use data submission and implement no JavaScript-based tracking. Standard HTTP logs are collected.
+regarding-js.du Regarding usage of JavaScript Listing of the different JavaScript scripts used in this website and the data they store in the browser.
+rework.du Due for rework Page is due for a rework!
+
+about.du About Me Contacts, resume, (Anti)bio, and software projects
+about/index.du About Me Contacts, resume, (Anti)bio, and software projects
+setup.du Setup Hardware and software setups I have or have had.
+setup/index.du Setup Hardware and software setups I have or have had.
+
+blog.du Blog Articles detailing personal experiences or exploration of certain topics
+blog/index.du Blog Articles detailing personal experiences or exploration of certain topics
+
+teaching.du Teaching List of subjects and their corresponding materials I've taught
+teaching/index.du Teaching List of subjects and their corresponding materials I've taught
+
+tutorials.du Tutorials Educational articles
+tutorials/index.du Tutorials Educational articles
+
+slides.du Slides Slides from presentations I've made
+slides/index.du Slides Slides from presentations I've made
+
+preserved-media.du Preserved media An assortment of documents, videos, etc. which are not made by me, but aren't archived on the internet or have the potential of permanently disappearing.
+preserved-media/index.du Preserved media An assortment of documents, videos, etc. which are not made by me, but aren't archived on the internet or have the potential of permanently disappearing.
+
+preserved-web-pages.du Preserved Web pages Web pages/sites with endangered archival, not made by me, that I've decided to host.
+preserved-web-pages/index.du Preserved Web pages Web pages/sites with endangered archival, not made by me, that I've decided to host.
+
+misc/index.du Miscellaneous Other types of content I've made, including documents, images, videos and web demos.
+misc/universitetski-belejki/index.du Университетски бележки Разнообразни материали, които съм правел през следването ми във ФМИ.