css changes

This commit is contained in:
2026-08-06 16:21:17 -07:00
parent 2562006786
commit 4a76a00a02
+12 -12
View File
@@ -9,9 +9,15 @@ env = Environment( loader = PackageLoader("blahblah") )
rollTemplate = env.get_template("roll_template.html.jinja")
postTemplate = env.get_template("post_template.html.jinja")
with open('config.toml', 'r') as f:
config = toml.load(f)
try:
with open('config.toml', 'r') as f:
config = toml.load(f)
except FileNotFoundError:
print('Error: config.toml not found (try renaming example.toml?). Exiting...')
sys.exit()
except:
print('An unknown error occurred. Exiting...')
sys.exit()
def generateBodies(db):
postCount = 0
@@ -22,24 +28,18 @@ def generateBodies(db):
newPost = '<div class="blobs mainbox blogpost">'
newPost = newPost + "<h2>" + p["title"] + "</h2><br>"
else:
newPost = '<div class="blobs mainbox micropost">'
newPost = '<div class="blobs mainbox blogpost micro">'
bodyText = p["body"]
if len(bodyText) > 512:
formattedBody = bodyText[0:512]
# formattedBody = markdown.markdown(formattedBody)
# bodyText = markdown.markdown(bodyText)
formattedBody = bodyText[0:509] + '...'
else:
formattedBody = bodyText
formattedBody = markdown.markdown(formattedBody)
bodyText = markdown.markdown(bodyText)
#newPost = newPost + formattedBody
#newPost = newPost + "</div>"
with open("./blog/posts/" + str(p["id"]) + ".html", "w") as f:
singlePost = newPost + bodyText
singlePost = singlePost + '</div>'
@@ -49,7 +49,7 @@ def generateBodies(db):
newPost = newPost + formattedBody
newPost = newPost + '<p style="font-size:small;text-align:right">' + datetime.fromtimestamp(ts).strftime('%B %-d, %Y ')
newPost = newPost + '<a href="' + config['server']['document_root'] + "/blog/posts/" + str(p["id"]) + '.html">'
newPost = newPost + 'permalink</a></p></div>'
newPost = newPost + 'link to full post</a></p></div>'
blogRoll.append(newPost)
postCount += 1