~dbalan/blogng unlisted

ref: build-try blogng/templates d---------
5a4058ca — Dhananjay Balan 2 years ago
Add RC scout to footer
1df7ecf6 — Dhananjay Balan 2 years ago
Serve fonts from local server and remove tufte fonts
58b20109 — Dhananjay Balan 2 years ago
Convert from old categories to tags

import sys
import yaml

with open(sys.argv[1]) as fp:
    data = fp.read()

if not data.find("---") == 0:
    # no head
    print("NO YAML HEAD FOUND")
    sys.exit(-1)

data = data[3:]
head_end = data.find("---")

head = data[0:head_end]
data = data[head_end+3:]

metadata = yaml.safe_load(head)

cats = metadata.pop('categories', None)
if cats != None:
    if type(cats) == list:
        tags = cats
    elif type(cats) == str:
        tags = cats.split()

    tags = list(map(lambda t: t.lower(), tags))

    metadata["tags"] = ", ".join(tags)
    new_data = f"---\n{yaml.dump(metadata, default_flow_style=False)}---{data}"
    # write it
    print(f"coverted: categories to tags: {tags} - {sys.argv[1]}")
    with open(sys.argv[1], "w") as fp:
        fp.write(new_data)
    sys.exit(0)

if not metadata.get("tags", None):
    metadata["tags"] = "untagged"
    new_data = f"---\n{yaml.dump(metadata, default_flow_style=False)}---{data}"
    print(f"untagged: {sys.argv[1]}")
    # write it
    with open(sys.argv[1], "w") as fp:
        fp.write(new_data)
    sys.exit(0)

print("No changes needed")
eb676545 — Dhananjay Balan 2 years ago
Implement Tags!
1abceb96 — Dhananjay Balan 2 years ago
Add link to feed on the footer
2b7012b9 — Dhananjay Balan 2 years ago
Fix source code footer
02cabfc3 — Dhananjay Balan 2 years ago
Remove google fonts
5a64e99c — Dhananjay Balan 2 years ago update_stack
New theme
1c57811f — Dhananjay Balan 4 years ago
Initial tags implementation
110cd0f6 — Dhananjay Balan 4 years ago
Fix about link and spacing of headings
e05902a4 — Dhananjay Balan 4 years ago
Fix langing page.
3241c491 — Dhananjay Balan 4 years ago
Update about page.
b037a8dd — Dhananjay Balan 4 years ago
Migrate to tufte-css
f1bf5b6c — Dhananjay Balan 4 years ago
intial commit