From c801ffd8f569533335fa36104570f6db77e681d6 Mon Sep 17 00:00:00 2001 From: Marvin Steadfast Date: Tue, 9 Feb 2016 10:07:51 +0000 Subject: [PATCH] added twitter cards --- pelicanconf.py | 6 +-- themes/flex/templates/article.html | 9 +++-- themes/flex/templates/base.html | 4 +- themes/flex/templates/partial/og.html | 28 +++++++------- themes/flex/templates/partial/og_article.html | 38 +++++++++---------- .../flex/templates/partial/twittercards.html | 10 +++++ 6 files changed, 53 insertions(+), 42 deletions(-) create mode 100644 themes/flex/templates/partial/twittercards.html diff --git a/pelicanconf.py b/pelicanconf.py index 9029a01..aa82ec0 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -4,8 +4,8 @@ from __future__ import unicode_literals AUTHOR = 'marvin' SITENAME = 'xsteadfastx' SITEURL = '' -SITELOGO = SITEURL + '/theme/img/avatar.png' -FAVICON = SITEURL + '/theme/img/favicon.png' +SITELOGO = '/theme/img/avatar.png' +FAVICON = '/theme/img/favicon.png' TIMEZONE = "Europe/Berlin" DESCRIPTION = "the cats are not what they seem" @@ -13,7 +13,7 @@ DESCRIPTION = "the cats are not what they seem" RELATIVE_URLS = True GITHUB_URL = 'http://github.com/xsteadfastx/' -TWITTER_NAME = 'xsteadfastx' +TWITTER_NAME = '@xsteadfastx' FLATTR_USER = 'xsteadfastx' PDF_GENERATOR = False REVERSE_CATEGORY_ORDER = True diff --git a/themes/flex/templates/article.html b/themes/flex/templates/article.html index e6e8d52..dfe56d3 100644 --- a/themes/flex/templates/article.html +++ b/themes/flex/templates/article.html @@ -1,10 +1,11 @@ {% extends "base.html" %} {% block meta %} - - - -{% include "partial/og_article.html" %} + + + + {% include "partial/og_article.html" %} + {% include "partial/twittercards.html" %} {% endblock %} {% block title %} – {{ article.title }}{% endblock %} diff --git a/themes/flex/templates/base.html b/themes/flex/templates/base.html index 5a5f227..10f5ae8 100644 --- a/themes/flex/templates/base.html +++ b/themes/flex/templates/base.html @@ -22,8 +22,8 @@ {% endif %} {% if FAVICON %} - - + + {% endif %} diff --git a/themes/flex/templates/partial/og.html b/themes/flex/templates/partial/og.html index 41e0c8c..eb8b5b6 100644 --- a/themes/flex/templates/partial/og.html +++ b/themes/flex/templates/partial/og.html @@ -1,14 +1,14 @@ -{% if OG_LOCALE %} - {% set default_locale = OG_LOCALE %} -{% else %} - {% set default_locale = 'en_US' %} -{% endif %} - - - - - - -{% if SITELOGO %} - -{% endif %} + {% if OG_LOCALE %} + {% set default_locale = OG_LOCALE %} + {% else %} + {% set default_locale = 'en_US' %} + {% endif %} + + + + + + + {% if SITELOGO %} + + {% endif %} diff --git a/themes/flex/templates/partial/og_article.html b/themes/flex/templates/partial/og_article.html index 50d4df3..ed9fbb1 100644 --- a/themes/flex/templates/partial/og_article.html +++ b/themes/flex/templates/partial/og_article.html @@ -1,19 +1,19 @@ -{% if OG_LOCALE %} - {% set default_locale = OG_LOCALE %} -{% else %} - {% set default_locale = 'en_US' %} -{% endif %} - - - - - - - - - - -{% for tag in article.tags %} - -{% endfor %} - + {% if OG_LOCALE %} + {% set default_locale = OG_LOCALE %} + {% else %} + {% set default_locale = 'en_US' %} + {% endif %} + + + + + + + + + + + {% for tag in article.tags %} + + {% endfor %} + diff --git a/themes/flex/templates/partial/twittercards.html b/themes/flex/templates/partial/twittercards.html new file mode 100644 index 0000000..bd15c85 --- /dev/null +++ b/themes/flex/templates/partial/twittercards.html @@ -0,0 +1,10 @@ + + {% if TWITTER_NAME %} + + + + + + + + {% endif %}