Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip HTML tags from SITENAME inside title tags. Fixes #3147 #3149

Merged
merged 2 commits into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pelican/themes/notmyidea/templates/author.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME }} - {{ author }}{% endblock %}
{% block title %}{{ SITENAME|striptags }} - {{ author }}{% endblock %}
2 changes: 1 addition & 1 deletion pelican/themes/notmyidea/templates/authors.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base.html" %}

{% block title %}{{ SITENAME }} - Authors{% endblock %}
{% block title %}{{ SITENAME|striptags }} - Authors{% endblock %}

{% block content %}

Expand Down
6 changes: 3 additions & 3 deletions pelican/themes/notmyidea/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content="Pelican" />
<title>{% block title %}{{ SITENAME }}{%endblock%}</title>
<title>{% block title %}{{ SITENAME|striptags }}{%endblock%}</title>
<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/{{ CSS_FILE }}" />
{% if FEED_ALL_ATOM %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Atom Feed" />
{% endif %}
{% if FEED_ALL_RSS %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} RSS Feed" />
{% endif %}
{% block extra_head %}{% endblock extra_head %}
{% endblock head %}
Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/notmyidea/templates/categories.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base.html" %}

{% block title %}{{ SITENAME }} - Categories{% endblock %}
{% block title %}{{ SITENAME|striptags }} - Categories{% endblock %}

{% block content %}

Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/notmyidea/templates/category.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME }} - {{ category }}{% endblock %}
{% block title %}{{ SITENAME|striptags }} - {{ category }}{% endblock %}
2 changes: 1 addition & 1 deletion pelican/themes/notmyidea/templates/tag.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME }} - {{ tag }}{% endblock %}
{% block title %}{{ SITENAME|striptags }} - {{ tag }}{% endblock %}
2 changes: 1 addition & 1 deletion pelican/themes/notmyidea/templates/tags.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base.html" %}

{% block title %}{{ SITENAME }} - Tags{% endblock %}
{% block title %}{{ SITENAME|striptags }} - Tags{% endblock %}

{% block content %}

Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/archives.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base.html" %}

{% block title %}{{ SITENAME }} - Archives{% endblock %}
{% block title %}{{ SITENAME|striptags }} - Archives{% endblock %}

{% block content %}
<h1>Archives for {{ SITENAME }}</h1>
Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/article.html
Original file line number Diff line number Diff line change
@@ -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() }}
Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/author.html
Original file line number Diff line number Diff line change
@@ -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 %}
<h1>Articles by {{ author }}</h1>
Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/authors.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base.html" %}

{% block title %}{{ SITENAME }} - Authors{% endblock %}
{% block title %}{{ SITENAME|striptags }} - Authors{% endblock %}

{% block content %}
<h1>Authors on {{ SITENAME }}</h1>
Expand Down
18 changes: 9 additions & 9 deletions pelican/themes/simple/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
<html lang="{% block html_lang %}{{ DEFAULT_LANG }}{% endblock html_lang %}">
<head>
{% block head %}
<title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
<title>{% block title %}{{ SITENAME|striptags }}{% endblock title %}</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if FEED_ALL_ATOM %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Full Atom Feed" />
{% endif %}
{% if FEED_ALL_RSS %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Full RSS Feed" />
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} Full RSS Feed" />
{% endif %}
{% if FEED_ATOM %}
<link href="{{ FEED_DOMAIN }}/{%if FEED_ATOM_URL %}{{ FEED_ATOM_URL }}{% else %}{{ FEED_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
<link href="{{ FEED_DOMAIN }}/{%if FEED_ATOM_URL %}{{ FEED_ATOM_URL }}{% else %}{{ FEED_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Atom Feed" />
{% endif %}
{% if FEED_RSS %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_RSS_URL %}{{ FEED_RSS_URL }}{% else %}{{ FEED_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
<link href="{{ FEED_DOMAIN }}/{% if FEED_RSS_URL %}{{ FEED_RSS_URL }}{% else %}{{ FEED_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} RSS Feed" />
{% endif %}
{% if CATEGORY_FEED_ATOM and category %}
<link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_ATOM_URL %}{{ CATEGORY_FEED_ATOM_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_ATOM.format(slug=category.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
<link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_ATOM_URL %}{{ CATEGORY_FEED_ATOM_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_ATOM.format(slug=category.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Categories Atom Feed" />
{% endif %}
{% if CATEGORY_FEED_RSS and category %}
<link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_RSS_URL %}{{ CATEGORY_FEED_RSS_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_RSS.format(slug=category.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
<link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_RSS_URL %}{{ CATEGORY_FEED_RSS_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_RSS.format(slug=category.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} Categories RSS Feed" />
{% endif %}
{% if TAG_FEED_ATOM and tag %}
<link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_ATOM_URL %}{{ TAG_FEED_ATOM_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_ATOM.format(slug=tag.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
<link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_ATOM_URL %}{{ TAG_FEED_ATOM_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_ATOM.format(slug=tag.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Tags Atom Feed" />
{% endif %}
{% if TAG_FEED_RSS and tag %}
<link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_RSS_URL %}{{ TAG_FEED_RSS_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_RSS.format(slug=tag.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
<link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_RSS_URL %}{{ TAG_FEED_RSS_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_RSS.format(slug=tag.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} Tags RSS Feed" />
{% endif %}
{% endblock head %}
</head>
Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/categories.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base.html" %}

{% block title %}{{ SITENAME }} - Categories{% endblock %}
{% block title %}{{ SITENAME|striptags }} - Categories{% endblock %}

{% block content %}
<h1>Categories on {{ SITENAME }}</h1>
Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/category.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "index.html" %}

{% block title %}{{ SITENAME }} - {{ category }} category{% endblock %}
{% block title %}{{ SITENAME|striptags }} - {{ category }} category{% endblock %}

{% block content_title %}
<h1>Articles in the {{ category }} category</h1>
Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/page.html
Original file line number Diff line number Diff line change
@@ -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() }}
Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/period_archives.html
Original file line number Diff line number Diff line change
@@ -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 %}
<h1>Archives for {{ period | reverse | join(' ') }}</h1>
Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/tag.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "index.html" %}

{% block title %}{{ SITENAME }} - {{ tag }} tag{% endblock %}
{% block title %}{{ SITENAME|striptags }} - {{ tag }} tag{% endblock %}

{% block content_title %}
<h1>Articles tagged with {{ tag }}</h1>
Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/tags.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base.html" %}

{% block title %}{{ SITENAME }} - Tags{% endblock %}
{% block title %}{{ SITENAME|striptags }} - Tags{% endblock %}

{% block content %}
<h1>Tags for {{ SITENAME }}</h1>
Expand Down