Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions error-404.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{!< default}}

{{!--
404 page. Inherits the default layout so visitors keep the theme's
navigation, footer, and overall look while they figure out where to go.
--}}

<main class="gh-main">

<article class="gh-article gh-canvas">

<header class="gh-article-header">
<h1 class="gh-article-title is-title">{{statusCode}}</h1>
<p class="gh-article-excerpt is-body">{{t "Page not found"}}</p>
</header>

<section class="gh-content is-body">
<p>
<a href="{{@site.url}}" class="gh-button">{{t "Go to the front page →"}}</a>
</p>
</section>

</article>

</main>

{{!-- Visitors landing here didn't find what they were looking for.
Suggest a few recent posts to help them re-engage. --}}
{{#get "posts" include="authors" limit="3" as |suggested|}}
{{#if suggested}}
<section class="gh-container is-grid gh-outer">
<div class="gh-container-inner gh-inner">
<h2 class="gh-container-title">{{t "Recent posts"}}</h2>
<div class="gh-main">
<div class="gh-feed">
{{#foreach suggested}}
{{> "post-card" lazyLoad=true}}
{{/foreach}}
</div>
</div>
</div>
</section>
{{/if}}
{{/get}}
86 changes: 86 additions & 0 deletions error.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{{!--
Generic error template — handles all non-404 errors (500, etc.).
Standalone (doesn't extend default.hbs) and kept lightweight on
purpose: minimal dependencies, no partials, no API calls.

The reasoning mirrors Casper's: 500 errors usually happen when
something on the server is struggling, so we don't want the error
page itself to compound the issue. Keep this template as
self-contained as possible.
--}}

<!DOCTYPE html>
<html lang="{{@site.locale}}">
<head>
<title>{{meta_title}}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="{{asset "built/screen.css"}}">
<style>
:root {
--background-color: {{@custom.site_background_color}}
}
</style>

<script>
/* The script for calculating the color contrast has been taken from
https://gomakethings.com/dynamically-changing-the-text-color-based-on-background-color-contrast-with-vanilla-js/ */
var accentColor = getComputedStyle(document.documentElement).getPropertyValue('--background-color');
accentColor = accentColor.trim().slice(1);

if (accentColor.length === 3) {
accentColor = accentColor[0] + accentColor[0] + accentColor[1] + accentColor[1] + accentColor[2] + accentColor[2];
}

var r = parseInt(accentColor.substr(0, 2), 16);
var g = parseInt(accentColor.substr(2, 2), 16);
var b = parseInt(accentColor.substr(4, 2), 16);
var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
var textColor = (yiq >= 128) ? 'dark' : 'light';

document.documentElement.className = `has-${textColor}-text`;
</script>

{{ghost_head}}
</head>
<body class="{{body_class}}">

Comment thread
coderabbitai[bot] marked this conversation as resolved.
<main class="gh-main">

<article class="gh-article gh-canvas">

<header class="gh-article-header">
<h1 class="gh-article-title is-title">{{statusCode}}</h1>
<p class="gh-article-excerpt is-body">{{message}}</p>
</header>

<section class="gh-content is-body">
<p>
<a href="{{@site.url}}" class="gh-button">{{t "Go to the front page →"}}</a>
</p>
</section>

{{#if errorDetails}}
<section class="gh-content is-body">
<h3>{{t "Theme errors"}}</h3>
<ul>
{{#foreach errorDetails}}
<li>
<strong>{{rule}}</strong>
{{#foreach failures}}
<p>{{ref}}: {{message}}</p>
{{/foreach}}
</li>
{{/foreach}}
</ul>
</section>
{{/if}}

</article>

</main>

{{ghost_foot}}

</body>
</html>
1 change: 1 addition & 0 deletions locales/context.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "solo/post.hbs",
"Older Posts": "ghost-tpl/pagination.hbs",
"Page {page} of {totalPages}": "alto/partials/pagination.hbs, ghost-tpl/pagination.hbs",
"Page not found": "Friendly message shown on 404 pages",
"Paid": "solo/partials/loop.hbs",
"Paid-members only": "casper/partials/post-card.hbs",
"Please enter a valid email address": "ghost-private/private.hbs",
Expand Down
1 change: 1 addition & 0 deletions locales/de-CH.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "",
"Older Posts": "",
"Page {page} of {totalPages}": "",
"Page not found": "",
"Paid": "",
"Paid-members only": "",
"Please enter a valid email address": "",
Expand Down
1 change: 1 addition & 0 deletions locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "Weiter →",
"Older Posts": "Ältere Beiträge",
"Page {page} of {totalPages}": "Seite {page} von {totalPages}",
"Page not found": "",
"Paid": "Kostenpflichtig",
"Paid-members only": "Nur für zahlende Mitglieder",
"Please enter a valid email address": "",
Expand Down
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "",
"Older Posts": "",
"Page {page} of {totalPages}": "",
"Page not found": "",
"Paid": "",
"Paid-members only": "",
"Please enter a valid email address": "",
Expand Down
1 change: 1 addition & 0 deletions locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "Suivant →",
"Older Posts": "Publications plus anciennes",
"Page {page} of {totalPages}": "Page {page} sur {totalPages}",
"Page not found": "Page introuvable",
"Paid": "Payant",
"Paid-members only": "Réservé aux abonnés payants",
"Please enter a valid email address": "",
Expand Down
1 change: 1 addition & 0 deletions locales/ga.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "",
"Older Posts": "",
"Page {page} of {totalPages}": "",
"Page not found": "",
"Paid": "",
"Paid-members only": "",
"Please enter a valid email address": "",
Expand Down
1 change: 1 addition & 0 deletions locales/gd.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "",
"Older Posts": "",
"Page {page} of {totalPages}": "",
"Page not found": "",
"Paid": "",
"Paid-members only": "",
"Please enter a valid email address": "",
Expand Down
1 change: 1 addition & 0 deletions locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "",
"Older Posts": "",
"Page {page} of {totalPages}": "",
"Page not found": "",
"Paid": "",
"Paid-members only": "",
"Please enter a valid email address": "",
Expand Down
1 change: 1 addition & 0 deletions locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "",
"Older Posts": "",
"Page {page} of {totalPages}": "",
"Page not found": "",
"Paid": "",
"Paid-members only": "",
"Please enter a valid email address": "",
Expand Down
1 change: 1 addition & 0 deletions locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "",
"Older Posts": "",
"Page {page} of {totalPages}": "",
"Page not found": "",
"Paid": "",
"Paid-members only": "",
"Please enter a valid email address": "",
Expand Down
1 change: 1 addition & 0 deletions locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "Sonraki →",
"Older Posts": "Daha Eski Yazılar",
"Page {page} of {totalPages}": "Sayfa {page} / {totalPages}",
"Page not found": "",
"Paid": "Ücretli",
"Paid-members only": "Ücretli üyelere özel",
"Please enter a valid email address": "",
Expand Down
1 change: 1 addition & 0 deletions locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "Далі →",
"Older Posts": "Старіші дописи",
"Page {page} of {totalPages}": "Сторінка {page} з {totalPages}",
"Page not found": "",
"Paid": "Платний",
"Paid-members only": "Тільки за платною підпискою",
"Please enter a valid email address": "",
Expand Down
1 change: 1 addition & 0 deletions locales/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "",
"Older Posts": "",
"Page {page} of {totalPages}": "",
"Page not found": "",
"Paid": "",
"Paid-members only": "付費會員限定",
"Please enter a valid email address": "",
Expand Down
1 change: 1 addition & 0 deletions locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Next →": "",
"Older Posts": "",
"Page {page} of {totalPages}": "",
"Page not found": "",
"Paid": "",
"Paid-members only": "",
"Please enter a valid email address": "",
Expand Down