Fix relative URL handling for posts

This commit is contained in:
Paweł Romanowski 2019-02-05 19:21:59 +00:00
parent bb1b834ad5
commit 4623287652
2 changed files with 2 additions and 2 deletions

View file

@ -7,7 +7,7 @@
Live demo here: https://pawroman.github.io/zola-theme-terminimal/ Live demo here: https://pawroman.github.io/zola-theme-terminimal/
Fork (not a port) of "Terminal" Hugo theme This theme is a fork (not a port) of "Terminal" Hugo theme
by Radosław Kozieł (aka. panr): by Radosław Kozieł (aka. panr):
https://github.com/panr/hugo-theme-terminal https://github.com/panr/hugo-theme-terminal

View file

@ -17,7 +17,7 @@
{% endfor -%} {% endfor -%}
{%- for item in menu_items %} {%- for item in menu_items %}
{%- set blog_post = not current_item and item.url == "/" -%} {%- set blog_post = not current_item and item.url == "$BASE_URL" -%}
<li {%- if current_item and item == current_item or blog_post %} class="active" {%- endif %}> <li {%- if current_item and item == current_item or blog_post %} class="active" {%- endif %}>
{%- if item.newtab -%} {%- if item.newtab -%}
<a href="{{ item.url | replace(from="$BASE_URL", to=config.base_url) | safe }}" target="_blank" rel="noopener noreferrer">{{ item.name | safe }}</a> <a href="{{ item.url | replace(from="$BASE_URL", to=config.base_url) | safe }}" target="_blank" rel="noopener noreferrer">{{ item.name | safe }}</a>