From fff5316b1bda9d7c460bea9f47e5f8686e99ade7 Mon Sep 17 00:00:00 2001 From: GullumLuvl <7593801+Gullumluvl@users.noreply.github.com> Date: Mon, 19 Jun 2023 12:52:31 +0200 Subject: [PATCH] strip html tags from SITENAME inside title tags. Fixes #3147 --- pelican/RELEASE.md | 3 +++ .../themes/notmyidea/templates/archives.html | 2 +- pelican/themes/notmyidea/templates/author.html | 2 +- .../themes/notmyidea/templates/authors.html | 2 +- pelican/themes/notmyidea/templates/base.html | 6 +++--- .../themes/notmyidea/templates/categories.html | 2 +- .../themes/notmyidea/templates/category.html | 2 +- pelican/themes/notmyidea/templates/tag.html | 2 +- pelican/themes/notmyidea/templates/tags.html | 2 +- pelican/themes/simple/templates/archives.html | 2 +- pelican/themes/simple/templates/article.html | 2 +- pelican/themes/simple/templates/author.html | 2 +- pelican/themes/simple/templates/authors.html | 2 +- pelican/themes/simple/templates/base.html | 18 +++++++++--------- .../themes/simple/templates/categories.html | 2 +- pelican/themes/simple/templates/category.html | 2 +- pelican/themes/simple/templates/page.html | 2 +- .../simple/templates/period_archives.html | 2 +- pelican/themes/simple/templates/tag.html | 2 +- pelican/themes/simple/templates/tags.html | 2 +- 20 files changed, 32 insertions(+), 29 deletions(-) create mode 100644 pelican/RELEASE.md diff --git a/pelican/RELEASE.md b/pelican/RELEASE.md new file mode 100644 index 0000000000..74ccc3dc41 --- /dev/null +++ b/pelican/RELEASE.md @@ -0,0 +1,3 @@ +Release type: patch + +strip html tags from SITENAME inside title tags (in default themes). diff --git a/pelican/themes/notmyidea/templates/archives.html b/pelican/themes/notmyidea/templates/archives.html index f6784942f4..d90ff1eeb9 100644 --- a/pelican/themes/notmyidea/templates/archives.html +++ b/pelican/themes/notmyidea/templates/archives.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %}
-

Archives for {{ SITENAME }}

+

Archives for {{ SITENAME|striptags }}

{% for article in dates %} diff --git a/pelican/themes/notmyidea/templates/author.html b/pelican/themes/notmyidea/templates/author.html index 0b372902d5..536ac50d71 100644 --- a/pelican/themes/notmyidea/templates/author.html +++ b/pelican/themes/notmyidea/templates/author.html @@ -1,2 +1,2 @@ {% extends "index.html" %} -{% block title %}{{ SITENAME }} - {{ author }}{% endblock %} +{% block title %}{{ SITENAME|striptags }} - {{ author }}{% endblock %} diff --git a/pelican/themes/notmyidea/templates/authors.html b/pelican/themes/notmyidea/templates/authors.html index e61a332f1e..b9f87e22f3 100644 --- a/pelican/themes/notmyidea/templates/authors.html +++ b/pelican/themes/notmyidea/templates/authors.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Authors{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Authors{% endblock %} {% block content %} diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index 2b30289994..8483f268e6 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -5,13 +5,13 @@ - {% block title %}{{ SITENAME }}{%endblock%} + {% block title %}{{ SITENAME|striptags }}{%endblock%} {% if FEED_ALL_ATOM %} - + {% endif %} {% if FEED_ALL_RSS %} - + {% endif %} {% block extra_head %}{% endblock extra_head %} {% endblock head %} diff --git a/pelican/themes/notmyidea/templates/categories.html b/pelican/themes/notmyidea/templates/categories.html index 07f6290a4c..7c5951c700 100644 --- a/pelican/themes/notmyidea/templates/categories.html +++ b/pelican/themes/notmyidea/templates/categories.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Categories{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Categories{% endblock %} {% block content %} diff --git a/pelican/themes/notmyidea/templates/category.html b/pelican/themes/notmyidea/templates/category.html index 56f8e93e94..ff14ed76c3 100644 --- a/pelican/themes/notmyidea/templates/category.html +++ b/pelican/themes/notmyidea/templates/category.html @@ -1,2 +1,2 @@ {% extends "index.html" %} -{% block title %}{{ SITENAME }} - {{ category }}{% endblock %} +{% block title %}{{ SITENAME|striptags }} - {{ category }}{% endblock %} diff --git a/pelican/themes/notmyidea/templates/tag.html b/pelican/themes/notmyidea/templates/tag.html index 68cdcba652..1e32857bc0 100644 --- a/pelican/themes/notmyidea/templates/tag.html +++ b/pelican/themes/notmyidea/templates/tag.html @@ -1,2 +1,2 @@ {% extends "index.html" %} -{% block title %}{{ SITENAME }} - {{ tag }}{% endblock %} +{% block title %}{{ SITENAME|striptags }} - {{ tag }}{% endblock %} diff --git a/pelican/themes/notmyidea/templates/tags.html b/pelican/themes/notmyidea/templates/tags.html index fb099557b9..a172932100 100644 --- a/pelican/themes/notmyidea/templates/tags.html +++ b/pelican/themes/notmyidea/templates/tags.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Tags{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Tags{% endblock %} {% block content %} diff --git a/pelican/themes/simple/templates/archives.html b/pelican/themes/simple/templates/archives.html index cd12950749..b7754c4555 100644 --- a/pelican/themes/simple/templates/archives.html +++ b/pelican/themes/simple/templates/archives.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Archives{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Archives{% endblock %} {% block content %}

Archives for {{ SITENAME }}

diff --git a/pelican/themes/simple/templates/article.html b/pelican/themes/simple/templates/article.html index 6dd0d967c6..a17f2759c5 100644 --- a/pelican/themes/simple/templates/article.html +++ b/pelican/themes/simple/templates/article.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block html_lang %}{{ article.lang }}{% endblock %} -{% block title %}{{ SITENAME }} - {{ article.title|striptags }}{% endblock %} +{% block title %}{{ SITENAME|striptags }} - {{ article.title|striptags }}{% endblock %} {% block head %} {{ super() }} diff --git a/pelican/themes/simple/templates/author.html b/pelican/themes/simple/templates/author.html index 79d22c7d14..64aadffb7f 100644 --- a/pelican/themes/simple/templates/author.html +++ b/pelican/themes/simple/templates/author.html @@ -1,6 +1,6 @@ {% extends "index.html" %} -{% block title %}{{ SITENAME }} - Articles by {{ author }}{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Articles by {{ author }}{% endblock %} {% block content_title %}

Articles by {{ author }}

diff --git a/pelican/themes/simple/templates/authors.html b/pelican/themes/simple/templates/authors.html index 9aee5db455..9b80b499d2 100644 --- a/pelican/themes/simple/templates/authors.html +++ b/pelican/themes/simple/templates/authors.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Authors{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Authors{% endblock %} {% block content %}

Authors on {{ SITENAME }}

diff --git a/pelican/themes/simple/templates/base.html b/pelican/themes/simple/templates/base.html index 1d8ae8438b..3125e5aad0 100644 --- a/pelican/themes/simple/templates/base.html +++ b/pelican/themes/simple/templates/base.html @@ -2,33 +2,33 @@ {% block head %} - {% block title %}{{ SITENAME }}{% endblock title %} + {% block title %}{{ SITENAME|striptags }}{% endblock title %} {% if FEED_ALL_ATOM %} - + {% endif %} {% if FEED_ALL_RSS %} - + {% endif %} {% if FEED_ATOM %} - + {% endif %} {% if FEED_RSS %} - + {% endif %} {% if CATEGORY_FEED_ATOM and category %} - + {% endif %} {% if CATEGORY_FEED_RSS and category %} - + {% endif %} {% if TAG_FEED_ATOM and tag %} - + {% endif %} {% if TAG_FEED_RSS and tag %} - + {% endif %} {% endblock head %} diff --git a/pelican/themes/simple/templates/categories.html b/pelican/themes/simple/templates/categories.html index 7999de4384..f099e88f4f 100644 --- a/pelican/themes/simple/templates/categories.html +++ b/pelican/themes/simple/templates/categories.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Categories{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Categories{% endblock %} {% block content %}

Categories on {{ SITENAME }}

diff --git a/pelican/themes/simple/templates/category.html b/pelican/themes/simple/templates/category.html index d73f6e3139..f7889d007e 100644 --- a/pelican/themes/simple/templates/category.html +++ b/pelican/themes/simple/templates/category.html @@ -1,6 +1,6 @@ {% extends "index.html" %} -{% block title %}{{ SITENAME }} - {{ category }} category{% endblock %} +{% block title %}{{ SITENAME|striptags }} - {{ category }} category{% endblock %} {% block content_title %}

Articles in the {{ category }} category

diff --git a/pelican/themes/simple/templates/page.html b/pelican/themes/simple/templates/page.html index 33344eac95..eea816a989 100644 --- a/pelican/themes/simple/templates/page.html +++ b/pelican/themes/simple/templates/page.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block html_lang %}{{ page.lang }}{% endblock %} -{% block title %}{{ SITENAME }} - {{ page.title|striptags }}{%endblock%} +{% block title %}{{ SITENAME|striptags }} - {{ page.title|striptags }}{%endblock%} {% block head %} {{ super() }} diff --git a/pelican/themes/simple/templates/period_archives.html b/pelican/themes/simple/templates/period_archives.html index e1ddf626f3..9cdc354d10 100644 --- a/pelican/themes/simple/templates/period_archives.html +++ b/pelican/themes/simple/templates/period_archives.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - {{ period | reverse | join(' ') }} archives{% endblock %} +{% block title %}{{ SITENAME|striptags }} - {{ period | reverse | join(' ') }} archives{% endblock %} {% block content %}

Archives for {{ period | reverse | join(' ') }}

diff --git a/pelican/themes/simple/templates/tag.html b/pelican/themes/simple/templates/tag.html index 9387813480..59725a0565 100644 --- a/pelican/themes/simple/templates/tag.html +++ b/pelican/themes/simple/templates/tag.html @@ -1,6 +1,6 @@ {% extends "index.html" %} -{% block title %}{{ SITENAME }} - {{ tag }} tag{% endblock %} +{% block title %}{{ SITENAME|striptags }} - {{ tag }} tag{% endblock %} {% block content_title %}

Articles tagged with {{ tag }}

diff --git a/pelican/themes/simple/templates/tags.html b/pelican/themes/simple/templates/tags.html index b90b0ac342..92c142d237 100644 --- a/pelican/themes/simple/templates/tags.html +++ b/pelican/themes/simple/templates/tags.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Tags{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Tags{% endblock %} {% block content %}

Tags for {{ SITENAME }}