Add safe to url outputs

This commit is contained in:
Trevor Elliott 2018-09-20 23:44:40 -07:00
parent 149cbff61b
commit f28d9f01be
5 changed files with 9 additions and 9 deletions

View file

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

View file

@ -12,11 +12,11 @@
<title>{% block title %}{{ config.title }}{% endblock title %}</title> <title>{% block title %}{{ config.title }}{% endblock title %}</title>
{% if config.generate_rss %} {% 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 %} {% endif %}
{% block css %} {% block css %}
<link rel="stylesheet" href="{{ get_url(path="site.css", trailing_slash=false) }}"> <link rel="stylesheet" href="{{ get_url(path="site.css", trailing_slash=false) | safe }}">
{% endblock css %} {% endblock css %}
{% block extra_head %} {% block extra_head %}
@ -32,7 +32,7 @@
{% for item in config.extra.after_dark_menu %} {% for item in config.extra.after_dark_menu %}
<a itemprop="url" <a itemprop="url"
class="{% if item.url | replace(from="$BASE_URL", to=config.base_url) == current_url %}active{% endif %}" class="{% if item.url | replace(from="$BASE_URL", to=config.base_url) == current_url %}active{% endif %}"
href="{{ item.url | replace(from="$BASE_URL", to=config.base_url) }}"> href="{{ item.url | safe | replace(from="$BASE_URL", to=config.base_url) }}">
<span itemprop="name">{{ item.name }} <span itemprop="name">{{ item.name }}
</span></a> </span></a>
{% endfor %} {% endfor %}

View file

@ -21,12 +21,12 @@
{% endif %} {% endif %}
{% if page.taxonomies.categories %} {% if page.taxonomies.categories %}
{% set category = page.taxonomies.categories[0] %} {% set category = page.taxonomies.categories[0] %}
in <a href="{{ get_taxonomy_url(kind="categories", name=category) }}">{{ category }}</a> in <a href="{{ get_taxonomy_url(kind="categories", name=category) | safe }}">{{ category }}</a>
{% endif %} {% endif %}
{% if page.taxonomies.tags %} {% if page.taxonomies.tags %}
and tagged and tagged
{% for tag in page.taxonomies.tags %} {% for tag in page.taxonomies.tags %}
<a href="{{ get_taxonomy_url(kind="tags", name=tag) }}">{{ tag }}</a> <a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">{{ tag }}</a>
{% if page.taxonomies.tags | length > 1 %} {% if page.taxonomies.tags | length > 1 %}
{% if loop.index != page.taxonomies.tags | length %} {% if loop.index != page.taxonomies.tags | length %}
{% if loop.index == page.taxonomies.tags | length - 1 %} {% if loop.index == page.taxonomies.tags | length - 1 %}

View file

@ -19,14 +19,14 @@
<article itemscope itemtype="http://schema.org/CreativeWork"> <article itemscope itemtype="http://schema.org/CreativeWork">
<header> <header>
<h2 itemprop="name"> <h2 itemprop="name">
<a href="{{ page.permalink }}">{{ page.title }}</a> <a href="{{ page.permalink | safe }}">{{ page.title }}</a>
</h2> </h2>
<span class="muted">{{ self::meta(page=page) }}</span> <span class="muted">{{ self::meta(page=page) }}</span>
</header> </header>
{% if page.summary %} {% if page.summary %}
<div itemprop="summary"> <div itemprop="summary">
{{ page.summary | safe }} {{ page.summary | safe }}
<nav class="readmore"><a itemprop="url" href="{{ page.permalink }}">Read More&nbsp;&raquo;</a></nav> <nav class="readmore"><a itemprop="url" href="{{ page.permalink | safe }}">Read More&nbsp;&raquo;</a></nav>
</div> </div>
{% endif %} {% endif %}
</article> </article>

View file

@ -10,7 +10,7 @@
{% if terms %} {% if terms %}
<ul> <ul>
{% for term in terms %} {% for term in terms %}
<li><a href="{{ term.permalink }}">{{ term.name }}</a> ({{ term.pages | length }})</li> <li><a href="{{ term.permalink | safe }}">{{ term.name }}</a> ({{ term.pages | length }})</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}