Skip to content
Permalink
Browse files
Merge branch 'master' into hackerthemes
  • Loading branch information
ralsina committed May 2, 2018
2 parents 29e1c6f + 477f9a0 commit fe4bb0d108bccefa770b7cc5696cefbcf4fb7940
Showing with 863 additions and 817 deletions.
  1. +40 −7 CHANGES.txt
  2. +21 −16 docs/manual.rst
  3. +0 −2 docs/template-variables.rst
  4. +19 −35 nikola/conf.py.in
  5. +2 −11 nikola/data/themes/base-jinja/templates/base_helper.tmpl
  6. +4 −4 nikola/data/themes/base-jinja/templates/math_helper.tmpl
  7. +15 −17 nikola/data/themes/base-jinja/templates/post_helper.tmpl
  8. +2 −11 nikola/data/themes/base/templates/base_helper.tmpl
  9. +4 −4 nikola/data/themes/base/templates/math_helper.tmpl
  10. +15 −17 nikola/data/themes/base/templates/post_helper.tmpl
  11. +22 −48 nikola/data/themes/bootblog4-jinja/templates/base_helper.tmpl
  12. +22 −48 nikola/data/themes/bootblog4/templates/base_helper.tmpl
  13. +22 −47 nikola/data/themes/bootstrap4-jinja/templates/base_helper.tmpl
  14. +22 −47 nikola/data/themes/bootstrap4/templates/base_helper.tmpl
  15. +74 −72 nikola/nikola.py
  16. +9 −5 nikola/plugin_categories.py
  17. +7 −3 nikola/plugins/command/import_wordpress.py
  18. +6 −1 nikola/plugins/compile/rest/__init__.py
  19. +2 −0 nikola/plugins/misc/taxonomies_classifier.py
  20. +2 −13 nikola/plugins/task/archive.py
  21. +0 −1 nikola/plugins/task/authors.py
  22. +1 −1 nikola/plugins/task/categories.py
  23. +8 −1 nikola/plugins/task/indexes.py
  24. +1 −1 nikola/plugins/task/page_index.py
  25. +3 −2 nikola/plugins/task/sections.py
  26. +1 −2 nikola/plugins/task/sitemap/__init__.py
  27. +1 −1 nikola/plugins/task/tags.py
  28. +20 −30 nikola/plugins/task/taxonomies.py
  29. +76 −18 nikola/post.py
  30. +5 −5 npm_assets/node_modules/bootstrap/README.md
  31. +1 −1 npm_assets/node_modules/bootstrap/dist/css/bootstrap-grid.css
  32. +1 −1 npm_assets/node_modules/bootstrap/dist/css/bootstrap-grid.css.map
  33. +1 −1 npm_assets/node_modules/bootstrap/dist/css/bootstrap-grid.min.css
  34. +1 −1 npm_assets/node_modules/bootstrap/dist/css/bootstrap-grid.min.css.map
  35. +3 −3 npm_assets/node_modules/bootstrap/dist/css/bootstrap-reboot.css
  36. +1 −1 npm_assets/node_modules/bootstrap/dist/css/bootstrap-reboot.css.map
  37. +2 −2 npm_assets/node_modules/bootstrap/dist/css/bootstrap-reboot.min.css
  38. +1 −1 npm_assets/node_modules/bootstrap/dist/css/bootstrap-reboot.min.css.map
  39. +54 −23 npm_assets/node_modules/bootstrap/dist/css/bootstrap.css
  40. +1 −1 npm_assets/node_modules/bootstrap/dist/css/bootstrap.css.map
  41. +2 −2 npm_assets/node_modules/bootstrap/dist/css/bootstrap.min.css
  42. +1 −1 npm_assets/node_modules/bootstrap/dist/css/bootstrap.min.css.map
  43. +71 −60 npm_assets/node_modules/bootstrap/dist/js/bootstrap.bundle.js
  44. +1 −1 npm_assets/node_modules/bootstrap/dist/js/bootstrap.bundle.js.map
  45. +2 −2 npm_assets/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js
  46. +1 −1 npm_assets/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map
  47. +31 −29 npm_assets/node_modules/bootstrap/dist/js/bootstrap.js
  48. +1 −1 npm_assets/node_modules/bootstrap/dist/js/bootstrap.js.map
  49. +2 −2 npm_assets/node_modules/bootstrap/dist/js/bootstrap.min.js
  50. +1 −1 npm_assets/node_modules/bootstrap/dist/js/bootstrap.min.js.map
  51. +6 −4 npm_assets/node_modules/bootstrap/js/dist/alert.js
  52. +1 −1 npm_assets/node_modules/bootstrap/js/dist/alert.js.map
  53. +2 −2 npm_assets/node_modules/bootstrap/js/dist/button.js
  54. +1 −1 npm_assets/node_modules/bootstrap/js/dist/button.js.map
  55. +2 −2 npm_assets/node_modules/bootstrap/js/dist/carousel.js
  56. +1 −1 npm_assets/node_modules/bootstrap/js/dist/carousel.js.map
  57. +3 −3 npm_assets/node_modules/bootstrap/js/dist/collapse.js
  58. +1 −1 npm_assets/node_modules/bootstrap/js/dist/collapse.js.map
  59. +2 −2 npm_assets/node_modules/bootstrap/js/dist/dropdown.js
  60. +1 −1 npm_assets/node_modules/bootstrap/js/dist/dropdown.js.map
  61. +1 −1 npm_assets/node_modules/bootstrap/js/dist/index.js
  62. +1 −1 npm_assets/node_modules/bootstrap/js/dist/index.js.map
  63. +3 −3 npm_assets/node_modules/bootstrap/js/dist/modal.js
  64. +1 −1 npm_assets/node_modules/bootstrap/js/dist/modal.js.map
  65. +2 −2 npm_assets/node_modules/bootstrap/js/dist/popover.js
  66. +1 −1 npm_assets/node_modules/bootstrap/js/dist/popover.js.map
  67. +3 −3 npm_assets/node_modules/bootstrap/js/dist/scrollspy.js
  68. +1 −1 npm_assets/node_modules/bootstrap/js/dist/scrollspy.js.map
  69. +2 −2 npm_assets/node_modules/bootstrap/js/dist/tab.js
  70. +1 −1 npm_assets/node_modules/bootstrap/js/dist/tab.js.map
  71. +3 −3 npm_assets/node_modules/bootstrap/js/dist/tooltip.js
  72. +1 −1 npm_assets/node_modules/bootstrap/js/dist/tooltip.js.map
  73. +1 −1 npm_assets/node_modules/bootstrap/js/dist/util.js
  74. +1 −1 npm_assets/node_modules/bootstrap/js/dist/util.js.map
  75. +6 −4 npm_assets/node_modules/bootstrap/js/src/alert.js
  76. +2 −2 npm_assets/node_modules/bootstrap/js/src/button.js
  77. +2 −2 npm_assets/node_modules/bootstrap/js/src/carousel.js
  78. +3 −3 npm_assets/node_modules/bootstrap/js/src/collapse.js
  79. +2 −2 npm_assets/node_modules/bootstrap/js/src/dropdown.js
  80. +1 −1 npm_assets/node_modules/bootstrap/js/src/index.js
  81. +4 −4 npm_assets/node_modules/bootstrap/js/src/modal.js
  82. +2 −2 npm_assets/node_modules/bootstrap/js/src/popover.js
  83. +3 −3 npm_assets/node_modules/bootstrap/js/src/scrollspy.js
  84. +2 −2 npm_assets/node_modules/bootstrap/js/src/tab.js
  85. +3 −3 npm_assets/node_modules/bootstrap/js/src/tooltip.js
  86. +1 −1 npm_assets/node_modules/bootstrap/js/src/util.js
  87. +32 −32 npm_assets/node_modules/bootstrap/package.json
  88. +1 −0 npm_assets/node_modules/bootstrap/scss/_carousel.scss
  89. +0 −8 npm_assets/node_modules/bootstrap/scss/_code.scss
  90. +6 −5 npm_assets/node_modules/bootstrap/scss/_custom-forms.scss
  91. +1 −2 npm_assets/node_modules/bootstrap/scss/_input-group.scss
  92. +17 −0 npm_assets/node_modules/bootstrap/scss/_print.scss
  93. +2 −4 npm_assets/node_modules/bootstrap/scss/_reboot.scss
  94. +2 −1 npm_assets/node_modules/bootstrap/scss/_variables.scss
  95. +1 −1 npm_assets/node_modules/bootstrap/scss/bootstrap-grid.scss
  96. +1 −1 npm_assets/node_modules/bootstrap/scss/bootstrap-reboot.scss
  97. +1 −1 npm_assets/node_modules/bootstrap/scss/bootstrap.scss
  98. +10 −0 npm_assets/node_modules/bootstrap/scss/mixins/_forms.scss
  99. +1 −1 npm_assets/node_modules/bootstrap/scss/mixins/_hover.scss
  100. +4 −2 npm_assets/node_modules/bootstrap/scss/mixins/_text-hide.scss
  101. +1 −1 npm_assets/node_modules/bootstrap/scss/utilities/_text.scss
  102. +8 −0 npm_assets/node_modules/moment/CHANGELOG.md
  103. +13 −13 npm_assets/node_modules/moment/locale/ru.js
  104. +13 −13 npm_assets/node_modules/moment/min/locales.js
  105. +1 −1 npm_assets/node_modules/moment/min/locales.min.js
  106. +15 −15 npm_assets/node_modules/moment/min/moment-with-locales.js
  107. +1 −1 npm_assets/node_modules/moment/min/moment-with-locales.min.js
  108. +1 −1 npm_assets/node_modules/moment/min/moment.min.js
  109. +13 −0 npm_assets/node_modules/moment/moment.d.ts
  110. +2 −2 npm_assets/node_modules/moment/moment.js
  111. +12 −12 npm_assets/node_modules/moment/package.json
  112. +1 −1 npm_assets/node_modules/moment/src/lib/units/day-of-month.js
  113. +13 −13 npm_assets/node_modules/moment/src/locale/ru.js
  114. +1 −1 npm_assets/node_modules/moment/src/locale/ug-cn.js
  115. +2 −2 npm_assets/node_modules/moment/src/moment.js
  116. +6 −6 npm_assets/package-lock.json
  117. +2 −2 npm_assets/package.json
  118. +1 −1 scripts/jinjify.py
@@ -1,10 +1,33 @@
New in master
=============

Important compatibility changes
-------------------------------

* Rename ``crumbs.tmpl`` to ``ui_helper.tmpl`` and the breadcrumbs
``bar`` function to ``breadcrumbs`` (your templates may need
changing as well)
* Rename ``post.is_mathjax`` to ``post.has_math``. Themes using
``post.is_mathjax`` must be updated; it is recommended that they are
changed to use ``math_helper.tmpl``.
* Reading reST docinfo metadata, including first heading as title,
requires ``USE_REST_DOCINFO_METADATA`` now (Issue #2987)
* RSS feeds might have changed their places due to ``RSS_PATH``
behavior changes (you may need to change ``RSS_PATH``,
``RSS_FILENAME_BASE``)
* Atom feeds for archives and Atom pagination are no longer supported
(Issue #3016)

Features
--------

* Support hackerthemes.com themes and renamed bootswatch_theme command subtheme (Issue #3049)
* Add ``DISABLE_MAIN_ATOM_FEED`` setting (Issue #3016, Issue #3039)
* Add ``ATOM_FILENAME_BASE`` setting (defaults to ``index`` for
existing sites, but ``feed`` for new sites) (Issue #3016)
* Tags ``draft``, ``private`` and ``mathjax`` are no longer treated
special if ``USE_TAG_METADATA`` is set to ``False`` (default for
new sites) (Issue #2761)
* Produce a better error message when a template referenced in another
template is missing (Issue #3055)
* Support captioned images and image ordering in galleries (Issue #3017)
@@ -62,7 +85,11 @@ Features
Bugfixes
--------

* Renamed ``DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED`` to ``DISABLE_INDEXES``
* Always follow ``FEED_LENGTH`` for Atom feeds
* Apply filters to all Atom feeds
* Read file metadata if compiler metadata exists and prefer it over
compiler metadata (Issue #3008)
* Rename ``DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED`` to ``DISABLE_INDEXES``
and ``DISABLE_INDEXES_PLUGIN_RSS_FEED`` to ``DISABLE_MAIN_RSS_FEED`` (Issue #3039)
* Make chart shortcode its own plugin and make the reST directive
depend on it.
@@ -110,6 +137,17 @@ Bugfixes
* Language was not passed to title and link generation for page indexes
* Addressed issue with snaps not allowing certain functions to work properly.

Removed conf.py settings
------------------------

The following settings have been removed. Nikola will now always
behave as if the value was what is displayed afer the setting name.

* ``FEED_PREVIEWIMAGE = True``
* ``SITEMAP_INCLUDE_FILELESS_DIRS = True``
* ``USE_OPEN_GRAPH = True``
* ``USE_BASE_TAG = False``

Removed features
----------------

@@ -124,12 +162,7 @@ Removed features
* Removed taxonomy option ``also_create_classifications_from_other_languages``
(Issue #2785)
* Removed old 7-line metadata format (Issue #2839)

Other changes
-------------

* Rename ``crumbs.tmpl`` to ``ui_helper.tmpl`` and the breadcrumbs
``bar`` function to ``breadcrumbs``
* Atom feeds are now limited to one page (Issue #3016)

New in v7.8.8
=============
@@ -3,7 +3,8 @@
.. date: 2012-03-30 23:00:00 UTC-03:00
.. link:
.. description:
.. tags: mathjax
.. tags:
.. has_math: true
.. author: The Nikola Team
The Nikola Handbook
@@ -299,8 +300,14 @@ date
Adding a timezone is recommended. (required for posts)

tags
Comma-separated tags of the post. Some tags have special meaning, including
``draft``, ``private``, ``mathjax``
Comma-separated tags of the post.

status
Can be set to ``published`` (default), ``featured``, ``draft``, or ``private``.

has_math
If set to ``true`` or ``yes``, MathJax resp. KaTeX support is enabled
for this post.

category
Like tags, except each post can have only one, and they usually have
@@ -809,11 +816,11 @@ Or you can completely customize the link using the ``READ_MORE_LINK`` option.
Drafts
~~~~~~

If you add a "draft" tag to a post, then it will not be shown in indexes and feeds.
It *will* be compiled, and if you deploy it it *will* be made available, so use
with care. If you wish your drafts to be not available in your deployed site, you
can set ``DEPLOY_DRAFTS = False`` in your configuration. This will not work if
lazily include ``nikola build`` in your ``DEPLOY_COMMANDS``.
If you set the ``status`` metadata field of a post to ``draft``, it will not be shown
in indexes and feeds. It *will* be compiled, and if you deploy it it *will* be made
available, so use with care. If you wish your drafts to be not available in your
deployed site, you can set ``DEPLOY_DRAFTS = False`` in your configuration. This will
not work if lazily include ``nikola build`` in your ``DEPLOY_COMMANDS``.

Also if a post has a date in the future, it will not be shown in indexes until
you rebuild after that date. This behavior can be disabled by setting
@@ -826,9 +833,9 @@ Generally, you want FUTURE_IS_NOW and DEPLOY_FUTURE to be the same value.
Private Posts
~~~~~~~~~~~~~

If you add a "private" tag to a post, then it will not be shown in indexes and feeds.
It *will* be compiled, and if you deploy it it *will* be made available, so it will
not generate 404s for people who had linked to it.
If you set the ``status`` metadata field of a post to ``private``, it will not be shown
in indexes and feeds. It *will* be compiled, and if you deploy it it *will* be made
available, so it will not generate 404s for people who had linked to it.

Queuing Posts
~~~~~~~~~~~~~
@@ -967,8 +974,6 @@ Please note that tags are case-sensitive and that you cannot have two tags that
ERROR: Nikola: Tag Nikola is used in: posts/second-post.rst
ERROR: Nikola: Tag nikola is used in: posts/1.rst

Nikola uses some tags to mark a post as “special” — those are ``draft``, ``private``, ``mathjax`` (for math support).

You can also generate a tag cloud with the `tx3_tag_cloud <https://plugins.getnikola.com/#tx3_tag_cloud>`_ plugin.

Categories
@@ -2288,9 +2293,9 @@ Nikola uses MathJax by default. If you want to use KaTeX (faster and prettier,
but may not support every feature yet), set ``USE_KATEX = True`` in
``conf.py``.

To use mathematics in a post, you **must** add the ``mathjax`` tag, no matter
which renderer you are using. (Exception: posts that are Jupyter Notebooks are
automatically marked as math)
To use mathematics in a post, you **must** set the ``has_math`` metadata field
to ``true``. (Exception: posts that are Jupyter Notebooks are automatically
marked as math)

.. Note to editors: the paragraph below uses U+200B, zero-width space. Don’t break it.
@@ -104,11 +104,9 @@ Name Type Descript
``twitter_card`` dict ``TWITTER_CARD`` setting, defaults to an empty dictionary
``url_replacer`` function ``Nikola.url_replacer`` function
``url_type`` str ``URL_TYPE`` setting
``use_base_tag`` bool ``USE_BASE_TAG`` setting
``use_bundles`` bool ``USE_BUNDLES`` setting
``use_cdn`` bool ``USE_CDN`` setting
``use_katex`` bool ``USE_KATEX`` setting
``use_open_graph`` bool ``USE_OPEN_GRAPH`` setting, defaults to True
``subtheme`` str? ``THEME_REVEAL_CONFIG_SUBTHEME`` setting (only if set — deprecated)
``transition`` str? ``THEME_REVEAL_CONFIG_TRANSITION`` setting (only if set — deprecated)
================================== ================================== ================================================================================
@@ -505,16 +505,6 @@ FRONT_INDEX_HEADER = {
# absolute: a complete URL (that includes the SITE_URL)
# URL_TYPE = 'rel_path'

# If USE_BASE_TAG is True, then all HTML files will include
# something like <base href=http://foo.var.com/baz/bat> to help
# the browser resolve relative links.
# Most people don’t need this tag; major websites don’t use it. Use
# only if you know what you’re doing. If this is True, your website
# will not be fully usable by manually opening .html files in your web
# browser (`nikola serve` or `nikola auto` is mandatory). Also, if you
# have mirrors of your site, they will point to SITE_URL everywhere.
USE_BASE_TAG = False

# Extension for RSS feed files
# RSS_EXTENSION = ".xml"

@@ -528,10 +518,17 @@ USE_BASE_TAG = False
# RSS_PATH = ""

# Final location for the blog main Atom feed is:
# output / TRANSLATION[lang] / ATOM_PATH / index.atom
# output / TRANSLATION[lang] / ATOM_PATH / ATOM_FILENAME_BASE ATOM_EXTENSION
# (translatable)
# ATOM_PATH = ""

# Atom filename base (without extension); used for indexes.
# (translatable)
ATOM_FILENAME_BASE = "feed"

# Extension for Atom feed files
# ATOM_EXTENSION = ".atom"

# Slug the Tag URL. Easier for users to type, special characters are
# often removed or replaced as well.
# SLUG_TAG_PATH = True
@@ -929,14 +926,6 @@ COMMENT_SYSTEM_ID = ${COMMENT_SYSTEM_ID}
# it will instead /foo/default.html => /foo)
STRIP_INDEXES = ${STRIP_INDEXES}

# Should the sitemap list directories which only include other directories
# and no files.
# Default to True
# If this is False
# e.g. /2012 includes only /01, /02, /03, /04, ...: don't add it to the sitemap
# if /2012 includes any files (including index.html)... add it to the sitemap
# SITEMAP_INCLUDE_FILELESS_DIRS = True

# List of files relative to the server root (!) that will be asked to be excluded
# from indexing and other robotic spidering. * is supported. Will only be effective
# if SITE_URL points to server root. The list is used to exclude resources from
@@ -1071,9 +1060,6 @@ MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.c
# between each other. Old Atom feeds with no changes are marked as archived.
# GENERATE_ATOM = False

# Extension for Atom feed files
# ATOM_EXTENSION = ".atom"

# Only include teasers in Atom and RSS feeds. Disabling include the full
# content. Defaults to True.
# FEED_TEASERS = True
@@ -1084,12 +1070,6 @@ MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.c
# Number of posts in Atom and RSS feeds.
# FEED_LENGTH = 10

# Include preview image as a <figure><img></figure> at the top of the entry.
# Requires FEED_PLAIN = False. If the preview image is found in the content,
# it will not be included again. Image will be included as-is, aim to optmize
# the image source for Feedly, Apple News, Flipboard, and other popular clients.
# FEED_PREVIEWIMAGE = True

# RSS_LINK is a HTML fragment to link the RSS or Atom feeds. If set to None,
# the base.tmpl will use the feed Nikola generates. However, you may want to
# change it for a FeedBurner feed or something else.
@@ -1210,11 +1190,6 @@ MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.c
# Additional metadata that is added to a post when creating a new_post
# ADDITIONAL_METADATA = {}

# Nikola supports Open Graph Protocol data for enhancing link sharing and
# discoverability of your site on Facebook, Google+, and other services.
# Open Graph is enabled by default.
# USE_OPEN_GRAPH = True

# Nikola supports Twitter Card summaries, but they are disabled by default.
# They make it possible for you to attach media to Tweets that link
# to your content.
@@ -1242,10 +1217,10 @@ MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.c
# Plugins you don't want to use. Be careful :-)
# DISABLED_PLUGINS = ["render_galleries"]

# Special settings to disable only parts of the indexes plugin (to allow RSS
# but no blog indexes, or to allow blog indexes and Atom but no site-wide RSS).
# Special settings to disable only parts of the indexes plugin.
# Use with care.
# DISABLE_INDEXES = False
# DISABLE_MAIN_ATOM_FEED = False
# DISABLE_MAIN_RSS_FEED = False

# Add the absolute paths to directories containing plugins to use them.
@@ -1300,3 +1275,12 @@ GLOBAL_CONTEXT = {}
# GLOBAL_CONTEXT as parameter when the template is about to be
# rendered
GLOBAL_CONTEXT_FILLER = []

# If set to True, the tags 'draft', 'mathjax' and 'private' have special
# meaning. If set to False, these tags are handled like regular tags.
USE_TAG_METADATA = False

# If set to True, a warning is issued if one of the 'draft', 'mathjax'
# and 'private' tags are found in a post. Useful for checking that
# migration was successful.
WARN_ABOUT_TAG_METADATA = False
@@ -4,29 +4,20 @@
{% macro html_headstart() %}
<!DOCTYPE html>
<html \
{% if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) or (comment_system == 'facebook') %}
prefix='
{% if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) %}
og: http://ogp.me/ns# article: http://ogp.me/ns/article#
{% endif %}
og: http://ogp.me/ns# article: http://ogp.me/ns/article#
{% if comment_system == 'facebook' %}
fb: http://ogp.me/ns/fb#
{% endif %}
' \
{% if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) %}
vocab="http://ogp.me/ns" \
{% endif %}
{% endif %}
vocab="http://ogp.me/ns" \
{% if is_rtl %}
dir="rtl"
{% endif %}

lang="{{ lang }}">
<head>
<meta charset="utf-8">
{% if use_base_tag %}
<base href="{{ abs_link(permalink) }}">
{% endif %}
{% if description %}
<meta name="description" content="{{ description|e }}">
{% endif %}
@@ -45,25 +45,25 @@
{% endmacro %}

{% macro math_scripts_ifpost(post) %}
{% if post.is_mathjax %}
{% if post.has_math %}
{{ math_scripts() }}
{% endif %}
{% endmacro %}

{% macro math_scripts_ifposts(posts) %}
{% if posts|selectattr("is_mathjax")|list %}
{% if posts|selectattr("has_math")|list %}
{{ math_scripts() }}
{% endif %}
{% endmacro %}

{% macro math_styles_ifpost(post) %}
{% if post.is_mathjax %}
{% if post.has_math %}
{{ math_styles() }}
{% endif %}
{% endmacro %}

{% macro math_styles_ifposts(posts) %}
{% if posts|selectattr("is_mathjax")|list %}
{% if posts|selectattr("has_math")|list %}
{{ math_styles() }}
{% endif %}
{% endmacro %}
@@ -41,31 +41,29 @@
{% endmacro %}

{% macro open_graph_metadata(post) %}
{% if use_open_graph %}
<meta property="og:site_name" content="{{ blog_title|e }}">
<meta property="og:title" content="{{ post.title()[:70]|e }}">
<meta property="og:url" content="{{ abs_link(permalink) }}">
{% if post.description() %}
<meta property="og:site_name" content="{{ blog_title|e }}">
<meta property="og:title" content="{{ post.title()[:70]|e }}">
<meta property="og:url" content="{{ abs_link(permalink) }}">
{% if post.description() %}
<meta property="og:description" content="{{ post.description()[:200]|e }}">
{% else %}
{% else %}
<meta property="og:description" content="{{ post.text(strip_html=True)[:200]|e }}">
{% endif %}
{% if post.previewimage %}
{% endif %}
{% if post.previewimage %}
<meta property="og:image" content="{{ url_replacer(permalink, post.previewimage, lang, 'absolute') }}">
{% endif %}
<meta property="og:type" content="article">
{% endif %}
<meta property="og:type" content="article">
{# Will only work with Pintrest and breaks everywhere else who expect a [Facebook] URI. #}
{# %if post.author(): #}
{# <meta property="article:author" content="{{ post.author()|e }}"> #}
{# %endif #}
{% if post.date.isoformat() %}
{% if post.date.isoformat() %}
<meta property="article:published_time" content="{{ post.formatted_date('webiso') }}">
{% endif %}
{% if post.tags %}
{% for tag in post.tags %}
<meta property="article:tag" content="{{ tag|e }}">
{% endfor %}
{% endif %}
{% endif %}
{% if post.tags %}
{% for tag in post.tags %}
<meta property="article:tag" content="{{ tag|e }}">
{% endfor %}
{% endif %}
{% endmacro %}

0 comments on commit fe4bb0d

Please sign in to comment.