Summary Files Commits Branches @commit @diff @stats
path: root / demo / awk-scripts / Blog-info.awk
diff options
context:
space:
mode:
Commita22ed0a0c480e06162d99a1dd77ad36c2338a6af (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-10-17 16:36:14 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-10-17 16:36:14 +0300
Filesc0263fa0ae9418dd03c59a36de22dfba6fb1f3ef /demo/awk-scripts/Blog-info.awk
csg-a22ed0a0c480e06162d99a1dd77ad36c2338a6af.tar
csg-a22ed0a0c480e06162d99a1dd77ad36c2338a6af.tar.gz
csg-a22ed0a0c480e06162d99a1dd77ad36c2338a6af.zip
Parent50dc2748ca7a3304a7e2e4accebc1c1e835439d3 (diff)
[demo] Updated with more detail
1 files changed, 6 insertions, 0 deletions
-rw-r--r--demo/awk-scripts/Blog-info.awk6
diff --git a/demo/awk-scripts/Blog-info.awk b/demo/awk-scripts/Blog-info.awk
new file mode 100644
index 0000000..89e044a
--- /dev/null
+++ b/demo/awk-scripts/Blog-info.awk
@@ -0,0 +1,6 @@
+# .*blog/.*/.*\.html
+# Adds an element with date created, date edited and estimated read time below h1
+
+/<h1/ {
+ $0 = $0 ORS "<div>Created: " created " | Last edited: " edited " | Read time: " (int(words / 180)+1) " min</div>"
+}