Summary Files Commits Branches @commit @diff @stats
path: root / meta / meta.awk
diff options
context:
space:
mode:
Commitbebe00ac39236bbfe6d00c5e620e2f26ba098ae8 (patch)
Author
 Kamen Mladenov <kamen@syndamia.com>
2026-09-14 12:36:01 +0300
Committer
 Kamen Mladenov <kamen@syndamia.com>
2026-09-14 12:36:01 +0300
Files3e48ba1a7a555de51db3ed77dcf81ce15f844dbb /meta/meta.awk
syndamia.com-bebe00ac39236bbfe6d00c5e620e2f26ba098ae8.tar
syndamia.com-bebe00ac39236bbfe6d00c5e620e2f26ba098ae8.tar.gz
syndamia.com-bebe00ac39236bbfe6d00c5e620e2f26ba098ae8.zip
Parent918bac7614e560678d51bfba2a25582a3284bdd9 (diff)
Parent3bf2c2004c1c3ea1748983247e1fcf12913d587f (diff)
Merge branch 'update_dunbar' into 'master'
feat!: Update dunbar markup See merge request Syndamia/syndamiadotcom!17
1 files changed, 0 insertions, 56 deletions
-rw-r--r--meta/meta.awk56
diff --git a/meta/meta.awk b/meta/meta.awk
deleted file mode 100644
index 58603d2..0000000
--- a/meta/meta.awk
+++ /dev/null
@@ -1,56 +0,0 @@
-BEGIN {
- FS="\t"
- while ((getline < ENVIRON["META"]) > 0) {
- if ($1 == "") continue
- meta_title[$1] = $2 " \\&mdash; Syndamia"
- meta_description[$1] = $3
- }
- FS=" "
-
- HEADER = getfile(ENVIRON["HEADER"])
- FOOTER = getfile(ENVIRON["FOOTER"])
-
- sitemap = ENVIRON["DST"] "/sitemap.xml"
- print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ORS \
- "<urlset" ORS \
- "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" ORS \
- "xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9" ORS \
- "http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\"" ORS \
- "xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">" > sitemap
-
- for (i = ARGC; i > 0; --i) {
- if (!ARGV[i]) continue
-
- #-- Add header and footer --#
- start = HEADER
- FILENAME = substr(ARGV[i], length(ENVIRON["DST"]) + 2)
- gsub(/\$TITLE/, meta_title[FILENAME], start)
- gsub(/\$DESCRIPTION/, meta_description[FILENAME], start)
-
- end = FOOTER
- sub(/html$/, "du", FILENAME)
- gsub(/\$DUNBAR_SOURCE/, "/" FILENAME, end)
-
- # Note: nawk (20250116) has what is probably a bug,
- # if you do "print getfile(f) > f", you'll crash.
- # This is probably because in getfile we close the
- # file, but after the function is finished, the > expects
- # the file to be opened (> probably opens the file before
- # evaluating the print).
- contents = start getfile(ARGV[i]) end
- print contents > ARGV[i]
-
- #-- Add to sitemap --#
- print "<url><loc>" ENVIRON["URL"] substr(ARGV[i], length(ENVIRON["DST"]) + 1) "</loc><lastmod>" date "</lastmod><priority>1.0</priority></url>" > sitemap
- }
-
- print "</urlset>" > sitemap
-}
-
-function getfile(filename, status, linebuf, filebuf) {
- while ((status = getline linebuf < filename) > 0)
- filebuf = filebuf linebuf ORS
- close(filename)
- sub(ORS "$", "", filebuf)
- return filebuf
-}