2
0
mirror of https://github.com/offen/website.git synced 2024-10-18 20:20:24 +02:00

use pelican articles for modelling blog logic

This commit is contained in:
Frederik Ring 2019-12-13 11:23:02 +01:00
parent ffd299a26b
commit f8c98060e4
6 changed files with 24 additions and 7 deletions

View File

@ -1,7 +1,7 @@
title: Laying the foundation for fair web analytics | Offen title: Laying the foundation for fair web analytics | Offen
description: Our milestone 1 achievements include extensible architecture, a localization option and an improved server structure. description: Our milestone 1 achievements include extensible architecture, a localization option and an improved server structure.
save_as: blog/laying-foundation-for-fair-web-analytics/index.html date: 2019-12-12
href: /blog/laying-foundation-for-fair-web-analytics/ slug: laying-foundation-for-fair-web-analytics
sitemap_priority: 0.7 sitemap_priority: 0.7
sm_image_url: /theme/images/offen-blog-0010-milestone1.jpg sm_image_url: /theme/images/offen-blog-0010-milestone1.jpg

View File

@ -18,6 +18,7 @@ TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None AUTHOR_FEED_RSS = None
SITEURL = 'http://localhost:8000' SITEURL = 'http://localhost:8000'
# pagination # pagination
@ -29,15 +30,20 @@ THEME = './theme'
DELETE_OUTPUT_DIRECTORY = True DELETE_OUTPUT_DIRECTORY = True
# dont create following standard pages # dont create following standard pages
AUTHORS_SAVE_AS = None AUTHOR_SAVE_AS = ''
ARCHIVES_SAVE_AS = None AUTHORS_SAVE_AS = ''
CATEGORIES_SAVE_AS = None ARCHIVE_SAVE_AS = ''
TAGS_SAVE_AS = None ARCHIVES_SAVE_AS = ''
CATEGORY_SAVE_AS = ''
CATEGORIES_SAVE_AS = ''
TAG_SAVE_AS = ''
TAGS_SAVE_AS = ''
# keep this for access to page variable # keep this for access to page variable
DIRECT_TEMPLATES = ['sitemap'] DIRECT_TEMPLATES = ['sitemap']
SITEMAP_SAVE_AS = 'sitemap.xml' SITEMAP_SAVE_AS = 'sitemap.xml'
PAGE_SAVE_AS = '{slug}/index.html' PAGE_SAVE_AS = '{slug}/index.html'
ARTICLE_SAVE_AS = 'blog/{slug}/index.html'
PLUGIN_PATHS = ['./plugins'] PLUGIN_PATHS = ['./plugins']
PLUGINS = ['decorate_content', 'assets'] PLUGINS = ['decorate_content', 'assets']

View File

@ -11,7 +11,6 @@ SITEURL = os.environ.get('SITEURL', 'https://www.offen.dev')
# RELATIVE_URLS = True # RELATIVE_URLS = True
FEED_ALL_ATOM = 'feeds/all.atom.xml' FEED_ALL_ATOM = 'feeds/all.atom.xml'
CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml'
DELETE_OUTPUT_DIRECTORY = True DELETE_OUTPUT_DIRECTORY = True

View File

@ -0,0 +1,2 @@
{% extends "base.html" %}
{% set page = article %}

View File

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
{% block head %}
<head> <head>
<title> <title>
{% block title %}{{ page.title }}{% endblock %} {% block title %}{{ page.title }}{% endblock %}
@ -26,6 +27,7 @@
<script async src="/script.js" data-account-id="{{ OFFEN_ACCOUNT_ID }}"></script> <script async src="/script.js" data-account-id="{{ OFFEN_ACCOUNT_ID }}"></script>
{% endif %} {% endif %}
</head> </head>
{% endblock %}
<body class="{{ page.template }}"> <body class="{{ page.template }}">
<div class="menu"> <div class="menu">
<section class="nav-bar"> <section class="nav-bar">

View File

@ -8,4 +8,12 @@
</url> </url>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% for article in articles %}
{% if not article.exclude_from_sitemap %}
<url>
<loc>{{ SITEURL }}/{{ article.save_as | replace('index.html', '') }}</loc>
<priority>{{ article.sitemap_priority or 0.5 }}</priority>
</url>
{% endif %}
{% endfor %}
</urlset> </urlset>