Commit Graph

22 Commits

Author SHA1 Message Date
Dhananjay Balan
0f851f0c3d Tracking freebsd current 2019-02-14 10:50:27 -05:00
Dhananjay Balan
58b20109cf 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")
2019-01-28 17:16:27 -05:00
Dhananjay Balan
f41c5e6a5a Experiments in owning data, part 2 2019-01-23 16:00:25 -05:00
Dhananjay Balan
8dab8ed59a Bump stack version
system ghc is now 8.6.3 but hakyll is not in any lts versions that
support (ghc 8.6.x)
2019-01-23 15:59:05 -05:00
Dhananjay Balan
88091a4040 Experiments in owning data, part 1 2019-01-20 14:13:04 -05:00
Dhananjay Balan
cd17762593 Edit 2019-01-12 20:01:58 -05:00
Dhananjay Balan
0fcacf308e Slight fix for versions 2019-01-08 19:13:31 -05:00
Dhananjay Balan
b1ce238846 Add new post 2019-01-08 19:07:48 -05:00
Dhananjay Balan
467c853f46 Update KUHS status 2019-01-08 16:28:12 -05:00
Dhananjay Balan
f8709d7941 fix 2018-08-05 11:35:54 +02:00
Dhananjay Balan
b8348dade6 Add freebsd notes. 2018-08-04 15:11:04 +02:00
Dhananjay Balan
8fe538da2e remove old docs causing problems 2018-03-09 13:31:56 +01:00
Dhananjay Balan
664f285881 Added MX records 2018-03-08 19:30:22 +01:00
Dhananjay Balan
bcc6dc9364 Add kuhs blog post 2018-03-08 19:26:15 +01:00
Dhananjay Balan
04ae21e93e Linux 4.12 commits. 2017-08-02 12:46:29 +02:00
Dhananjay Balan
f9f59c596a remove test entry 2017-08-02 12:28:32 +02:00
Dhananjay Balan
d264053e82 new script to generate blog entries 2017-08-02 12:08:57 +02:00
Dhananjay Balan
92ab27a0f9 remove me 2017-08-02 00:28:58 +02:00
Dhananjay Balan
1c57811f1f Initial tags implementation 2017-02-01 16:38:22 +01:00
Dhananjay Balan
b037a8dde1 Migrate to tufte-css 2017-02-01 11:52:12 +01:00
Dhananjay Balan
6f0e756a56 fix images 2017-01-31 21:15:52 +01:00
Dhananjay Balan
3a30fb8a07 Compatibility with Octopress site.
Don't break urls.
 1. New Route function which generates routes compatible with old blog.
 2. Renamed posts folder to blog.
2017-01-31 20:44:01 +01:00