Add ability to hide blog posts from the listing
This website needs some work...
This commit is contained in:
parent
dfcd75fc08
commit
21ebf1ccf8
@ -3,6 +3,7 @@ title: Website update
|
|||||||
author: flewkey
|
author: flewkey
|
||||||
timestamp: 1593548958
|
timestamp: 1593548958
|
||||||
license: CC-BY
|
license: CC-BY
|
||||||
|
visibility: hidden
|
||||||
|
|
||||||
I like blogs. Blogs are one of the only suitable platforms for people to
|
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
|
properly present ideas. There are no character limits, the author can embed
|
||||||
|
@ -14,8 +14,9 @@ def gen_list(files, ext, limit=-1, mini=False):
|
|||||||
for post in files:
|
for post in files:
|
||||||
with open("posts/"+post, "r", encoding="utf-8") as file_in:
|
with open("posts/"+post, "r", encoding="utf-8") as file_in:
|
||||||
html = md.convert(file_in.read())
|
html = md.convert(file_in.read())
|
||||||
md.Meta["template"] = "post_preview" if not mini else "post_preview_mini"
|
if "visibility" not in md.Meta or md.Meta["visibility"] == "hidden":
|
||||||
items += template(escape_braces(html), "blog/"+post[:-3]+ext, ext, md.Meta)
|
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
|
i += 1
|
||||||
if limit >= 0 and i >= limit:
|
if limit >= 0 and i >= limit:
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user