summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-07-25 21:20:51 -0400
committerrsiddharth <s@ricketyspace.net>2020-07-25 21:20:51 -0400
commit31c1305939101e1105f36dc211f496ea5bd74173 (patch)
treedff53cd913306c5f89a0cfa1e08d3650b7155985 /bin
parent219b86dfe891f6072577889f75525367a399e101 (diff)
bin/html: add lhref.
* bin/html (lhref): New function.
Diffstat (limited to 'bin')
-rw-r--r--bin/html7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/html b/bin/html
index 2554287..d5aa145 100644
--- a/bin/html
+++ b/bin/html
@@ -138,6 +138,13 @@ def markdown(c):
return r.stdout
+def lhref(sec, s, l):
+ if l == 'en':
+ return '<a href="/{}/{}">{}</a>'.format(sec, s, l)
+ else:
+ return '<a href="/{}/{}/{}">{}</a>'.format(sec, s, l, l)
+
+
def html(sec, f):
c = read(f.path)
s, l = slug(f.path)