Browse Source

Fix URL escapes in hrefs

master
Paweł Romanowski 6 years ago
parent
commit
1e013d81e4
  1. 8
      templates/index.html
  2. 12
      templates/macros/post.html
  3. 4
      templates/tags/list.html
  4. 4
      templates/tags/single.html

8
templates/index.html

@ -11,11 +11,11 @@
{{ head_macros::head(config=config) }}
{%- if config.generate_rss %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml") }}">
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml") | safe }}">
{% endif -%}
{%- if config.extra.favicon %}
<link rel="shortcut icon" type="{{ config.extra.favicon_mimetype | default(value="image/x-icon") }}" href="{{ config.extra.favicon }}">
<link rel="shortcut icon" type="{{ config.extra.favicon_mimetype | default(value="image/x-icon") }}" href="{{ config.extra.favicon | safe }}">
{% endif -%}
{%- block extra_head %}
@ -68,7 +68,7 @@
<div class="pagination__buttons">
{%- if paginator.previous %}
<span class="button previous">
<a href="{{ paginator.previous }}">
<a href="{{ paginator.previous | safe }}">
<span class="button__icon"></span>&nbsp;
<span class="button__text">Newer posts</span>
</a>
@ -76,7 +76,7 @@
{% endif -%}
{%- if paginator.next %}
<span class="button next">
<a href="{{ paginator.next }}">
<a href="{{ paginator.next | safe }}">
<span class="button__text">Older posts</span>&nbsp;
<span class="button__icon"></span>
</a>

12
templates/macros/post.html

@ -5,7 +5,7 @@
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
<a class="read-more button" href="{{ page.permalink }}">
<a class="read-more button" href="{{ page.permalink | safe }}">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
@ -37,7 +37,7 @@
<div class="pagination__buttons">
{%- if page.later %}
<span class="button previous">
<a href="{{ page.later.permalink }}">
<a href="{{ page.later.permalink | safe }}">
<span class="button__icon"></span>&nbsp;
<span class="button__text">{{ page.later.title }}</span>
</a>
@ -45,7 +45,7 @@
{% endif %}
{% if page.earlier %}
<span class="button next">
<a href="{{ page.earlier.permalink }}">
<a href="{{ page.earlier.permalink | safe }}">
<span class="button__text">{{ page.earlier.title }}</span>&nbsp;
<span class="button__icon"></span>
</a>
@ -58,7 +58,7 @@
{% macro header(page) %}
<h1 class="post-title"><a href="{{ page.permalink }}">{{ page.title }}</a></h1>
<h1 class="post-title"><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h1>
<div class="post-meta-inline">
{{ post_macros::date(page=page) }}
</div>
@ -74,7 +74,7 @@
{% continue %}
{% endif -%}
<li class="post-list">
<a href="{{ page.permalink }}">
<a href="{{ page.permalink | safe }}">
<span class="post-date">{{ page.date }}</span>
:: <span class="post-list-title">{{ page.title }}</span></a>
{{ post_macros::tags(page=page, short=true) }}
@ -95,7 +95,7 @@
{%- set sep = "&nbsp;" -%}
{% endif -%}
{%- for tag in page.taxonomies.tags %}
<a class="post-tag" href="{{ get_taxonomy_url(kind='tags', name=tag) }}">#{{ tag }}</a>
<a class="post-tag" href="{{ get_taxonomy_url(kind='tags', name=tag) | safe }}">#{{ tag }}</a>
{%- if not loop.last %}{{ sep | safe }}{% endif -%}
{% endfor -%}
</span>

4
templates/tags/list.html

@ -7,11 +7,11 @@
<ul>
{% for term in terms %}
<li class="tag-list">
<a href="{{ term.permalink }}">
<a href="{{ term.permalink | safe }}">
{{ term.name }} ({{ term.pages | length }} post{{ term.pages | length | pluralize }})
</a>
</li>
{% endfor %}
</ul>
</div>
{% endblock content %}
{% endblock content %}

4
templates/tags/single.html

@ -7,10 +7,10 @@
({{ term.pages | length }} post{{ term.pages | length | pluralize }})
</h1>
<a href="{{ config.base_url }}/tags">
<a href="{{ config.base_url | safe }}/tags">
Show all tags
</a>
{{ post_macros::list_posts(pages=term.pages) }}
</div>
{% endblock content %}
{% endblock content %}

Loading…
Cancel
Save