Add variable DISABLE_URL_HASH for pretty URL in browser (#88)

This commit is contained in:
Dmytro Litvinov 2017-02-23 18:47:51 +02:00 committed by Alexandre Vicenzi
parent bea8a3724d
commit a76e802b8f
2 changed files with 3 additions and 3 deletions

View file

@ -94,7 +94,7 @@
{% set PAGES_SORT_ATTRIBUTE = 'title' %} {% set PAGES_SORT_ATTRIBUTE = 'title' %}
{%- endif %} {%- endif %}
{% for page in pages|sort(attribute=PAGES_SORT_ATTRIBUTE) %} {% for page in pages|sort(attribute=PAGES_SORT_ATTRIBUTE) %}
<li><a href="{{ SITEURL }}/{{ page.url }}#{{ page.slug }}">{{ page.title }}</a></li> <li><a href="{{ SITEURL }}/{{ page.url }}{% if not DISABLE_URL_HASH %}#{{ page.slug }}{% endif %}">{{ page.title }}</a></li>
{% endfor %} {% endfor %}
{% for name, link in LINKS %} {% for name, link in LINKS %}

View file

@ -15,7 +15,7 @@
{% for article in articles_page.object_list %} {% for article in articles_page.object_list %}
<article> <article>
<header> <header>
<h2><a href="{{ SITEURL }}/{{ article.url }}#{{ article.slug }}">{{ article.title }}</a></h2> <h2><a href="{{ SITEURL }}/{{ article.url }}{% if not DISABLE_URL_HASH %}#{{ article.slug }}{% endif %}">{{ article.title }}</a></h2>
<p> <p>
{{ _('Posted on %(when)s in %(category)s', {{ _('Posted on %(when)s in %(category)s',
when=article.locale_date, when=article.locale_date,
@ -37,7 +37,7 @@
{% if summarise or article.metadata['summary'] or SUMMARY_MAX_LENGTH %} {% if summarise or article.metadata['summary'] or SUMMARY_MAX_LENGTH %}
{{ article.summary }} {{ article.summary }}
<br> <br>
<a class="btn" href="{{ SITEURL }}/{{ article.url }}#{{ article.slug }}">{{ _('Continue reading') }}</a> <a class="btn" href="{{ SITEURL }}/{{ article.url }}{% if not DISABLE_URL_HASH %}#{{ article.slug }}{% endif %}">{{ _('Continue reading') }}</a>
{% else %} {% else %}
{{ article.content }} {{ article.content }}
{% endif %} {% endif %}