mirror of
https://github.com/pawroman/zola-theme-terminimal.git
synced 2025-01-09 12:11:05 +01:00
Merge pull request #7 from ipetkov/404
Add 404 page which fits the rest of the theme
This commit is contained in:
commit
880b4bdb84
16
templates/404.html
Normal file
16
templates/404.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{% extends "index.html" %}
|
||||
|
||||
{% block title %}
|
||||
404
|
||||
{% endblock title %}
|
||||
|
||||
{% block header_menu %}
|
||||
{{ menu_macros::menu_for(config=config, current_item="") }}
|
||||
{% endblock header_menu %}
|
||||
|
||||
{% block content %}
|
||||
<div class="post">
|
||||
<h1 class="post-title">{% block heading %}Lost?{% endblock heading %}</h1>
|
||||
<p>{% block message %}This page does not exist.{% endblock message %}</p>
|
||||
</div>
|
||||
{% endblock content %}
|
|
@ -47,7 +47,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{% block header_menu %}
|
||||
{{ menu_macros::menu(config=config, current_path=current_path) }}
|
||||
{% endblock header_menu %}
|
||||
</header>
|
||||
{% endblock header %}
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
{%- if config.extra.menu_items %}
|
||||
{%- set menu_items = config.extra.menu_items -%}
|
||||
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner">
|
||||
{%- for item in menu_items %}
|
||||
{%- set abs_item_url = item.url | replace(from="$BASE_URL", to=config.base_url) -%}
|
||||
{%- set is_current = current_url == abs_item_url ~ "/"
|
||||
|
@ -27,6 +25,16 @@
|
|||
{%- set current_item = base_item -%}
|
||||
{% endif -%}
|
||||
|
||||
{{ menu_macros::menu_for(config=config, current_item=current_item) }}
|
||||
{% endif -%}
|
||||
{% endmacro menu %}
|
||||
|
||||
{% macro menu_for(config, current_item) %}
|
||||
{%- if config.extra.menu_items %}
|
||||
{%- set menu_items = config.extra.menu_items -%}
|
||||
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner">
|
||||
{%- for item in menu_items %}
|
||||
<li {%- if current_item and current_item == item %} class="active" {%- endif %}>
|
||||
{%- if item.newtab -%}
|
||||
|
|
Loading…
Reference in a new issue