Merge pull request #248 from saagit/none_plugins

Fix compatibility with Pelican 4.5.0 when PLUGINS is not set
This commit is contained in:
Alexandre Vicenzi 2020-09-19 19:25:46 +02:00 committed by GitHub
commit e7a0009a1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View file

@ -30,7 +30,7 @@
when=article.locale_date,
category='<a href="%s/%s">%s</a>'|format(SITEURL, article.category.url, article.category)|safe) }}
{% if 'post_stats' in PLUGINS %}
{% if PLUGINS and 'post_stats' in PLUGINS %}
&#8226; {{ _('%(minutes)s min read', minutes=article.stats['read_mins']) }}
{% endif %}
</p>

View file

@ -69,7 +69,7 @@
href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/pygments/{{ PYGMENTS_STYLE|default('github') }}.min.css">
{% endif %}
{% if 'tipue_search' in PLUGINS %}
{% if PLUGINS and 'tipue_search' in PLUGINS %}
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/jquery.min.js"></script>
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch.min.js"></script>
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch.min.js"></script>
@ -156,7 +156,7 @@
{% if SITESUBTITLE %}<p>{{ SITESUBTITLE }}</p>{% endif %}
{% if 'tipue_search' in PLUGINS %}
{% if PLUGINS and 'tipue_search' in PLUGINS %}
<form class="navbar-search" action="/search.html" role="search">
<input type="text" name="q" id="tipue_search_input" placeholder="{{ _('Search...') }}">
</form>
@ -280,7 +280,7 @@
{% include 'partial/github.html' %}
{% endif %}
{% if 'tipue_search' in PLUGINS %}
{% if PLUGINS and 'tipue_search' in PLUGINS %}
<script>
$(document).ready(function() {
$('#tipue_search_input').tipuesearch();

View file

@ -28,7 +28,7 @@
{% endfor %}
{% endif %}
{% if 'post_stats' in PLUGINS %}
{% if PLUGINS and 'post_stats' in PLUGINS %}
&#8226; {{ _('%(minutes)s min read', minutes=article.stats['read_mins']) }}
{% endif %}
</p>

View file

@ -1,4 +1,4 @@
{% if 'neighbors' in PLUGINS %}
{% if PLUGINS and 'neighbors' in PLUGINS %}
<div class="neighbors">
{% if article.prev_article %}
<a class="btn float-left" href="{{ SITEURL }}/{{ article.prev_article.url }}" title="{{ article.prev_article.title|striptags }}">

View file

@ -1,4 +1,4 @@
{% if 'tipue_search' in PLUGINS %}
{% if PLUGINS and 'tipue_search' in PLUGINS %}
{% extends 'base.html' %}
{% block title %}{{ _('Search') }} - {{ SITENAME|striptags }}{% endblock title %}
{% block content %}