Added themed 404 page

Currently requires a hacky fix of the index.html template as the
404 only has the config in its context.
This commit is contained in:
Teo-CD 2020-10-03 00:09:39 +02:00
parent e53382eaa0
commit 39cffcefc7
2 changed files with 40 additions and 0 deletions

28
templates/404.html Normal file
View file

@ -0,0 +1,28 @@
{% extends "index.html" %}
{% import "post_macros.html" as post_macros %}
{% block content %}
<!-- START NAV -->
{% block header %}
{{ super() }}
{% endblock header %}
<!-- END NAV -->
<main>
<section class="container">
<div class="columns is-desktop">
<div class="column is-10-desktop is-offset-1-desktop">
<article itemscope itemtype="http://schema.org/BlogPosting">
<div class="card article">
<div class="card-content">
<div itemprop="articleBody" class="content article-body">
<h1>404!</h1>
This page could not be found, perhaps it is not available in the current language or simply does not exist.
</div>
</div>
</div>
</article>
</div>
</div>
</section>
</main>
{% endblock content %}

View file

@ -53,6 +53,18 @@
{% macro navbar() %} {% macro navbar() %}
{% if config.extra.zulma_menu or config.extra.zulma_brand or config.build_search_index %} {% if config.extra.zulma_menu or config.extra.zulma_brand or config.build_search_index %}
{# This is used for the 404 template, as it only gets the config in its context.
This is clearly hacky and should be changed eventually #}
{% if not lang %}
{% set lang = config.default_language %}
{% endif %}
{% if not current_url %}
{% set current_url = config.base_url %}
{% endif %}
<header> <header>
<nav class="navbar"> <nav class="navbar">
<div class="container"> <div class="container">