Skip to content

Commit

Permalink
Update 404
Browse files Browse the repository at this point in the history
  • Loading branch information
RickCogley committed Apr 20, 2023
1 parent 285a8d7 commit 3d6d51c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const server = new Server({
server.use(expires());
server.use(notFound({
root: `${Deno.cwd()}/_dist`,
page404: "/404/",
page404: "/en/404/index.html",
}));
server.use(www({
add: false, // false to remove, true to add it.
Expand Down
3 changes: 2 additions & 1 deletion src/404.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
layout: layouts/error.njk
title: "404: Page Not Found"
series: utility
hidemenu: true
lang: en
description: |
Sorry, the page you are looking for could not be found.
content:
title: "<span>Error 404:</span><br />Page Not Found"
description: Sorry, but the page you are looking for could not be found. Search below for English pages, or return home. <br>(日本語ページの検索は[日本語トップ](/)から。)
description: Sorry, but the page you are looking for could not be found. Search below for English pages, or return home. <br>(日本語ページの検索は[日本語トップ](/)から。)
button:
title: Return Home
29 changes: 28 additions & 1 deletion src/_includes/templates/doc-navbar.njk
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,32 @@
</ul>
</details>
{% endfor %}
</nav>

{% if lang == "ja" %}
{% set page = search.page("url=/") %}
{% if page %}
<a class="menu-highlight" href="{{ page.data.url }}">{{ page.data.title or slug }}</a>
{% endif %}
<ul class="menu">
{% asyncEach item in nav.menu("/", "lang=ja hidemenu=undefined|false").children %}
<li>
{% include "templates/menu_item.njk" %}
</li>
{% endeach %}
</ul>
{% else %}
{% set page = search.page("url=/en/") %}
{% if page %}
<a class="menu-highlight" href="{{ page.data.url }}">{{ page.data.title or slug }}</a>
{% endif %}
<ul class="menu">
{% asyncEach item in nav.menu("/en/", "lang=en hidemenu=undefined|false").children %}
<li>
{% include "templates/menu_item.njk" %}
</li>
{% endeach %}
</ul>
{% endif %}


</nav>

0 comments on commit 3d6d51c

Please sign in to comment.