From fe054ac33b1d28ae16dbae9305651188f0b22608 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 20 Jul 2025 19:46:45 +0300 Subject: feat(src/ext): Implemented a large part of the awk_edits functionality via dunbar --- ext/meta.awk | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ext/meta.awk (limited to 'ext/meta.awk') 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 " — 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"] + } +} -- cgit v1.3.1-26-gb76a