aboutsummaryrefslogtreecommitdiff
path: root/templates/404.html
blob: c499874736ebf48f51889d0a78a589bbaf672473 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{% extends "base.html" %}

{%- block seo -%}
  {{ super() }}
  {%- set title = "404 Page not found" -%}
  {%- if config.title -%}
    {%- set title_addition = title_separator ~ config.title -%}
  {%- else -%}
    {%- set title_addition = "" -%}
  {%- endif -%}
  {%- set description = config.description -%}
  {{<seo config={config}  title={title}  title_addition={title_addition}  description={description or ""}  is_404={true} />}}
{%- endblock seo -%}

{%- block content %}
{%- set uglyurls = (config.extra.uglyurls or false) -%}
{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
    <div>
      <h1>404 :(</h1>
      {#- Default English message #}
      <p>Page not found, maybe moved{% if config.languages | length > 1 %} or not in this language{% endif %}. {% if config.build_search_index %}Try searching or {% endif %}<a href="{{ config.base_url | safe }}/{%- if uglyurls %}index.html{%- endif %}">go to homepage</a>.</p>

      {# Iterate through each language and display the localised 404 message #}
      {%- for lcode, language in config.languages -%}
        {%- if lcode != config.default_language -%}
        {%- set i18n_404 = load_data(path="i18n/" ~ lcode ~ '.toml', required=false) -%}
        {%- if not i18n_404 -%}{%- set i18n_404 = load_data(path="themes/abridge/i18n/" ~ lcode ~ ".toml", required=false) -%}{%- endif %}

          <p>{{<translate key="404_not_found"  default="404_not_found"  i18n={i18n_404} />}}{{<translate key="full_stop"  default="."  i18n={i18n_404} />}} {% if config.build_search_index %}{{<translate key="404_try_search"  default="Try searching or"  i18n={i18n_404} />}}{% endif %} <a href="{{ config.base_url }}/{{ lcode }}/{%- if uglyurls %}index.html{%- endif %}">{{<translate key="404_go_home"  default="go to homepage"  i18n={i18n_404} />}}</a>{{<translate key="full_stop"  default="."  i18n={i18n_404} />}}</p>
        {%- endif -%}
      {%- endfor -%}
      {% if config.default_language != "en" %}
        <p>{{<translate key="404_not_found"  default="404_not_found"  i18n={i18n} />}}{{<translate key="full_stop"  default="."  i18n={i18n} />}} {% if config.build_search_index %}{{<translate key="404_try_search"  default="Try searching or"  i18n={i18n} />}}{% endif %} <a href="{{ config.base_url }}/{%- if uglyurls %}index.html{%- endif %}">{{<translate key="404_go_home"  default="go to homepage"  i18n={i18n} />}}</a>{{<translate key="full_stop"  default="."  i18n={i18n} />}}</p>
      {% endif %}
    </div>
{%- endblock content %}