1
0

Add ability to hide blog posts from the listing

This website needs some work...
This commit is contained in:
Ryan Fox 2021-06-05 04:51:14 +00:00
parent dfcd75fc08
commit 21ebf1ccf8
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E
2 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@ title: Website update
author: flewkey
timestamp: 1593548958
license: CC-BY
visibility: hidden
I like blogs. Blogs are one of the only suitable platforms for people to
properly present ideas. There are no character limits, the author can embed

View File

@ -14,8 +14,9 @@ def gen_list(files, ext, limit=-1, mini=False):
for post in files:
with open("posts/"+post, "r", encoding="utf-8") as file_in:
html = md.convert(file_in.read())
md.Meta["template"] = "post_preview" if not mini else "post_preview_mini"
items += template(escape_braces(html), "blog/"+post[:-3]+ext, ext, md.Meta)
if "visibility" not in md.Meta or md.Meta["visibility"] == "hidden":
md.Meta["template"] = "post_preview" if not mini else "post_preview_mini"
items += template(escape_braces(html), "blog/"+post[:-3]+ext, ext, md.Meta)
i += 1
if limit >= 0 and i >= limit:
break;