Summary Files Commits Branches @commit @diff @stats
path: root / awk-edits / Header-title.awk
diff options
context:
space:
mode:
Commit3552c3e6cb666ac3f063652862e3b287cd30c904 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-10-23 15:34:14 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-10-23 15:34:14 +0300
Filesedde566ff9d0d35643cf1f86c9ffef5287000c9a /awk-edits/Header-title.awk
syndamia.com-3552c3e6cb666ac3f063652862e3b287cd30c904.tar
syndamia.com-3552c3e6cb666ac3f063652862e3b287cd30c904.tar.gz
syndamia.com-3552c3e6cb666ac3f063652862e3b287cd30c904.zip
Parent15b153225ef24e37348220505aa0e8aa221f415b (diff)
[generate] Reworked to use csg, updated awk scripts with csg in mind and updated info in _header
1 files changed, 0 insertions, 28 deletions
-rw-r--r--awk-edits/Header-title.awk28
diff --git a/awk-edits/Header-title.awk b/awk-edits/Header-title.awk
deleted file mode 100644
index 42fafa7..0000000
--- a/awk-edits/Header-title.awk
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# == About ==
-#
-# Every page has a og:title meta tag, which has to be generated from the page
-# itself. The title tag is automatically filled in by ssg.
-# The value for the meta tag is "[TITLE]" and it gets replaced with all text
-# inside first h1 header tag.
-
-BEGIN {
- h1Index = 0;
-
- # When this loop finishes, $0 will have the first line containing an h1 header
- # tag, and h1Index will have it's starting position
- while (h1Index == 0 && getline < ARGV[1])
- h1Index = index($0, "<h1");
- close(ARGV[1]); # FILENAME isn't set during BEGIN
-
- # Removes the opening tag
- gsub(/<h1[^>]*>/, "");
- # Remove all HTML character codes, since they're in the form "&...;" and the &
- # will be treated as the character for replacement in gsub
- gsub(/&[^;]*;/, "");
- title = substr($0, h1Index, index($0, "</h1") - h1Index);
-}
-
-/\[TITLE\]/ {
- gsub(/\[TITLE\]/, title);
-}