Commit d1f6d125 authored by berumuron's avatar berumuron
Browse files

add: Allow to exclude articles from blog page

This is quite similar to the private feature, instead that it's now
possible to have a "serie" page and feed.
parent b750c318
......@@ -125,7 +125,9 @@ def main(environment):
# Load a "blog" page which has access to the list of articles
blog_template_filepath = os.path.join("templates", "blog.html")
blog_articles = [
article for article in articles.values() if not article.is_private()
article
for article in articles.values()
if not article.is_private() and article.on_blog()
]
if os.path.exists(blog_template_filepath):
blog_page = utils.build_blog_page(blog_articles, series, configuration)
......
......@@ -63,6 +63,9 @@ class Article:
site_timezone = self.meta.get("SITE_TIMEZONE", "UTC")
return pytz.timezone(site_timezone)
def on_blog(self):
return self.meta.get("ARTICLE_BLOG", "true") == "true"
def is_private(self):
return self.meta.get("ARTICLE_PRIVATE", "false") == "true"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment