From 1b67f824b998785a7b2c3e84328356aab422afe9 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Fri, 13 Dec 2019 12:24:58 +0100 Subject: [PATCH] add feed page, link to newest article via status --- homepage/pelicanconf.py | 10 +++------- homepage/theme/templates/archives.html | 20 ++++++++++++++++++++ homepage/theme/templates/article.html | 9 ++++++++- homepage/theme/templates/base.html | 24 ++++++++++++------------ homepage/theme/templates/index.html | 2 +- homepage/theme/templates/page.html | 8 ++++++++ 6 files changed, 52 insertions(+), 21 deletions(-) create mode 100644 homepage/theme/templates/archives.html diff --git a/homepage/pelicanconf.py b/homepage/pelicanconf.py index a67ad12..f9cbd20 100644 --- a/homepage/pelicanconf.py +++ b/homepage/pelicanconf.py @@ -18,7 +18,6 @@ TRANSLATION_FEED_ATOM = None AUTHOR_FEED_ATOM = None AUTHOR_FEED_RSS = None - SITEURL = 'http://localhost:8000' # pagination @@ -29,18 +28,17 @@ THEME = './theme' # Delete the output directory before generating new files. DELETE_OUTPUT_DIRECTORY = True +DIRECT_TEMPLATES = ['sitemap', 'archives'] + # dont create following standard pages AUTHOR_SAVE_AS = '' AUTHORS_SAVE_AS = '' -ARCHIVE_SAVE_AS = '' -ARCHIVES_SAVE_AS = '' CATEGORY_SAVE_AS = '' CATEGORIES_SAVE_AS = '' TAG_SAVE_AS = '' TAGS_SAVE_AS = '' -# keep this for access to page variable -DIRECT_TEMPLATES = ['sitemap'] +ARCHIVES_SAVE_AS = 'blog/index.html' SITEMAP_SAVE_AS = 'sitemap.xml' PAGE_SAVE_AS = '{slug}/index.html' ARTICLE_SAVE_AS = 'blog/{slug}/index.html' @@ -61,5 +59,3 @@ LINKEDIN_URL = 'https://www.linkedin.com/company/hioffen' TWITTER_URL = 'https://twitter.com/hioffen' OFFEN_ACCOUNT_ID = '9b63c4d8-65c0-438c-9d30-cc4b01173393' - -STATUS_URL = '/blog/laying-foundation-for-fair-web-analytics' diff --git a/homepage/theme/templates/archives.html b/homepage/theme/templates/archives.html new file mode 100644 index 0000000..eb15ef7 --- /dev/null +++ b/homepage/theme/templates/archives.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} + +{% set title = 'Feed' %} +{% set description = 'Description' %} +{% set href = 'blog/' %} +{% set no_stats = False %} +{% set template = 'archives' %} + +{% block content %} + {% for article in articles %} + {% if loop.index != 1 %} +
+ {% endif %} +
+
+ {{ article.content }} +
+
+ {% endfor %} +{% endblock %} diff --git a/homepage/theme/templates/article.html b/homepage/theme/templates/article.html index 8e10df9..0406c2c 100644 --- a/homepage/theme/templates/article.html +++ b/homepage/theme/templates/article.html @@ -1,2 +1,9 @@ {% extends "base.html" %} -{% set page = article %} + +{% set title = article.title %} +{% set description = article.description %} +{% set href = article.save_as.replace('index.html', '') %} +{% set sm_image_url = article.sm_image_url %} +{% set no_stats = article.no_stats %} +{% set template = article.template %} +{% set content = article.content %} diff --git a/homepage/theme/templates/base.html b/homepage/theme/templates/base.html index bb44915..b5ed70f 100644 --- a/homepage/theme/templates/base.html +++ b/homepage/theme/templates/base.html @@ -3,32 +3,32 @@ {% block head %} - {% block title %}{{ page.title }}{% endblock %} + {% block title %}{{ title }}{% endblock %} - + - - + + - - + + - + {% assets filters="libsass,postcss,cssmin", output="css/style.min.css", "css/normalize.css", "css/fonts.css", "css/style.scss" %} {% endassets %} - {% if OFFEN_ACCOUNT_ID and not page.no_stats %} + {% if OFFEN_ACCOUNT_ID and not no_stats %} {% endif %} {% endblock %} - + diff --git a/homepage/theme/templates/page.html b/homepage/theme/templates/page.html index 94d9808..2dab6bb 100644 --- a/homepage/theme/templates/page.html +++ b/homepage/theme/templates/page.html @@ -1 +1,9 @@ {% extends "base.html" %} + +{% set title = page.title %} +{% set description = page.description %} +{% set href = page.save_as.replace('index.html', '') %} +{% set sm_image_url = page.sm_image_url %} +{% set no_stats = page.no_stats %} +{% set template = page.template %} +{% set content = page.content %}