Skip to content
Merged
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
19 changes: 13 additions & 6 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
layout: default
title: Page Not Found
canonical_url: /404.html
permalink: /404.html
---
{% include nav.html %}
<main class="front-section">
<div style="padding: 3rem 0; min-height: 60vh; display: flex; align-items: center;">
<div class="container">
<div class="masthead" style="max-width: 600px; margin: 0 auto; background-color: transparent;">
<div class="masthead" style="max-width: 600px; margin: 0 auto; background-color: transparent; text-align: center;">
<div class="lead">404</div>
<h1>Page Not Found</h1>
<p class="light">The page you're looking for doesn't exist. It might have been moved, deleted, or you entered the wrong URL.</p>
Expand All @@ -16,15 +17,14 @@ <h1>Page Not Found</h1>
<a href="/doc/" class="btn">Documentation</a>
</div>
</div>
</div>
</div>
</main>
</div>

<style>
.masthead .lead {
font-size: 8rem;
font-weight: 700;
color:#22C55E;
color: #22C55E;
font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
line-height: 1;
margin-bottom: 0.5rem;
Expand All @@ -41,8 +41,10 @@ <h1>Page Not Found</h1>
}

.masthead .flex {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 1rem;
}

@media (max-width: 525px) {
Expand All @@ -56,6 +58,7 @@ <h1>Page Not Found</h1>

.masthead p {
font-size: 1.1rem;
margin-bottom: 2rem;
}

.masthead .flex {
Expand All @@ -66,7 +69,11 @@ <h1>Page Not Found</h1>
.masthead .btn {
width: 100%;
max-width: 280px;
text-align: center !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
padding: 0.75rem 1rem !important;
}
}
</style>

4 changes: 4 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@

<link href="/css/main.css" rel="stylesheet">
<link href="/css/neovim-hi.css" rel="stylesheet">
{% unless page.url == "/404.html" %}
<link rel="canonical" href="{{ site.url }}{% if page.canonical_url %}{{ page.canonical_url }}{% else %}{{ page.url }}{% endif %}" />
Comment on lines +26 to 27
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, the key change is that rel="canonical" is skipped for the 404 page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly right. That's the core fix - should have highlighted that upfront instead of all the implementation details

{% else %}
<meta name="robots" content="noindex">
{% endunless %}
</head>

<body>
Expand Down