import secrets import orgparse,os,re from datetime import datetime thisyear = datetime.now().strftime("%Y") year = 1993 concernedfiles = [] while year < int(thisyear) + 1: month = 0 while month < 13: if month < 10: strmonth = "0" + str(month) else: strmonth = str(month) recdir = str(year) + "/" + strmonth + "/" fullpath = secrets.orgpath + recdir if os.path.exists(fullpath): for file in sorted(os.listdir(fullpath)): filename = fullpath + str(file) if filename.endswith(".org"): concernedfiles.append(filename) month = month + 1 year = year + 1 posts = [] for file in concernedfiles: filedate = file[-14:-4] parsefile = orgparse.load(file) try: for node in parsefile.children: if node.heading == "site": for post in node.children: if "post" in post.tags: writefile = open(filedate + ".org","w") writefile.write("#+TITLE: " + post.heading + "\n#+REALTITLE: " + post.properties["realtitle"] + "\n#+OGDESC: " + post.properties["ogdesc"]+ "\n#+CATEGORY: " + post.properties["category"] + "\n#+COMMENTS: " + post.properties["comments"] + "\n" + post.get_body(format="raw") + "\n") try: for child in post.children: if "noexport" not in child.tags: if child.heading == "yes": writefile.write("\n") else: writefile.write("* " + child.heading + "\n") writefile.write(child.get_body(format="raw") + "\n") except: pass writefile.close() thedict = {} thedict["real"] = post.properties["realtitle"] thedict["date"] = filedate if post.properties["category"] == "reminding myself how to do stuff": thedict["category"] = "techbro" elif post.properties["category"] == "writing notes": thedict["category"] = "writing" elif post.properties["category"] == "journal memes": thedict["category"] = "meme" elif post.properties["category"] == "revues": thedict["category"] = "revue" else: thedict["category"] = post.properties["category"] try: thedict["media"] = post.properties["type"] except: pass posts.append(thedict) except: pass posts = sorted(posts,key=lambda d: d["date"],reverse=True) writeindex = open("build/index.html","w") writeindex.write("\n\n\n\n\npraze • Notes\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n
\n
\n

Notes

\n

This is the part of the site where I post long-ish-form writing I seem to have the embarrassing need to share … I guess you’d call it a blog.

\n

Posts are listed in reverse chronological order. Please be aware of posting dates – my opinions are constantly changing and evolving, and the longer ago something was written, the more likely it is that I’ll have since come to disagree with it completely … or in the case of more technical stuff, details may simply be out of date.

\n

Some of these posts were originally made on a now-deleted Dreamwidth account. Toggle the boxes to show/hide posts in the relevant category.

\n\n\n\n\n\n\n\n\n\n\n\n
\n
\n\n
\n\n\n\n") writeindex.close()