From cd7d10f5c96ca703f6e343d72f80b2f16080479e Mon Sep 17 00:00:00 2001 From: lioman Date: Tue, 9 Mar 2021 08:57:48 +0100 Subject: [PATCH 1/2] move search files to search page - To speed up page load the js files should be loaded on bottom of page. - search files are only needed if you search. Move them to search page - instantiate tipue search only on search page --- templates/base.html | 12 ------------ templates/search.html | 39 +++++++++++++++++++++------------------ 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/templates/base.html b/templates/base.html index 5ff35dc..0da863e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -295,18 +295,6 @@ {% include 'partial/github.html' %} {% endif %} - {% if PLUGINS and 'tipue_search' in PLUGINS %} - - - - - - {% endif %} - {% block additional_js %}{% endblock %} diff --git a/templates/search.html b/templates/search.html index 1252834..1a6128b 100644 --- a/templates/search.html +++ b/templates/search.html @@ -1,22 +1,25 @@ -{% if PLUGINS and 'tipue_search' in PLUGINS %} -{% extends 'base.html' %} -{% block title %}{{ _('Search') }} - {{ SITENAME|striptags }}{% endblock title %} +{% if PLUGINS and 'tipue_search' in PLUGINS %} {% extends 'base.html' %} {% +block title %}{{ _('Search') }} - {{ SITENAME|striptags }}{% endblock title %} {% block content %} -
-
-

{{ _('Search Results') }}

-
-
+
+

{{ _('Search Results') }}

+
+
-{% endblock content %} -{% endif %} +{% endblock content %} {% block additional_js %} + + + + + +{% endblock %} {% endif %} From 1b2844e92673c5efad1d01df5be30a22f3ef55fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20Kirchg=C3=A4ssner?= Date: Fri, 2 Sep 2022 09:43:56 +0200 Subject: [PATCH 2/2] check for seo, neighbors as namespace plugins These two plugins moved recently to new versions. They have a module name preceeded by 'pelican.plugins.' --- templates/partial/jsonld_article.html | 2 +- templates/partial/neighbors.html | 2 +- templates/partial/og.html | 2 +- templates/partial/og_article.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/partial/jsonld_article.html b/templates/partial/jsonld_article.html index abcc32b..c4ba80e 100644 --- a/templates/partial/jsonld_article.html +++ b/templates/partial/jsonld_article.html @@ -1,4 +1,4 @@ -{% if not PLUGINS or 'seo' not in PLUGINS %} +{% if not PLUGINS or 'seo' not in PLUGINS or 'pelican.plugins.seo' not in PLUGINS%} {% if SITELOGO %} {% set default_cover = SITELOGO %} {% else %} diff --git a/templates/partial/neighbors.html b/templates/partial/neighbors.html index a03a9e1..65bfada 100644 --- a/templates/partial/neighbors.html +++ b/templates/partial/neighbors.html @@ -1,4 +1,4 @@ -{% if PLUGINS and 'neighbors' in PLUGINS %} +{% if PLUGINS and ('neighbors' in PLUGINS or 'pelican.plugins.neighbors' in PLUGINS) %}