Skip to content

Commit 99f6e48

Browse files
authored
skip <link rel="canonical"> for 404 page #384
* Add custom 404 page with Neovim branding - Integrates with existing Jekyll layout system - Matches site color scheme and navigation - Provides helpful links for users - Includes auto-redirect for common typos * refactor: optimize 404 page to use existing CSS utilities * refactor: remove custom classes, use existing masthead/lead styles - Replace error-content with existing .masthead class - Use .lead for 404 number styling - Remove helpful-links section (redundant with nav) - Drop error-buttons class, use .flex directly - Eliminate unnecessary custom CSS classes * style: restore typewriter style font for 404. * refactor: switch to golden-grid, remove bottom margin * style: update color .masthead * feat: add custom 404 page with GitHub Pages permalink support - Add custom 404 page with improved mobile layout - Improve mobile button text alignment and responsive design - Add proper YAML front matter for GitHub Pages compatibility - Update default layout to exclude canonical links and add noindex for 404 page - Add flexbox layout and gap spacing for better button presentation
1 parent 2e99027 commit 99f6e48

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

404.html

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
layout: default
33
title: Page Not Found
44
canonical_url: /404.html
5+
permalink: /404.html
56
---
67
{% include nav.html %}
7-
<main class="front-section">
8+
<div style="padding: 3rem 0; min-height: 60vh; display: flex; align-items: center;">
89
<div class="container">
9-
<div class="masthead" style="max-width: 600px; margin: 0 auto; background-color: transparent;">
10+
<div class="masthead" style="max-width: 600px; margin: 0 auto; background-color: transparent; text-align: center;">
1011
<div class="lead">404</div>
1112
<h1>Page Not Found</h1>
1213
<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>
@@ -16,15 +17,14 @@ <h1>Page Not Found</h1>
1617
<a href="/doc/" class="btn">Documentation</a>
1718
</div>
1819
</div>
19-
</div>
2020
</div>
21-
</main>
21+
</div>
2222

2323
<style>
2424
.masthead .lead {
2525
font-size: 8rem;
2626
font-weight: 700;
27-
color:#22C55E;
27+
color: #22C55E;
2828
font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
2929
line-height: 1;
3030
margin-bottom: 0.5rem;
@@ -41,8 +41,10 @@ <h1>Page Not Found</h1>
4141
}
4242

4343
.masthead .flex {
44+
display: flex;
4445
justify-content: center;
4546
flex-wrap: wrap;
47+
gap: 1rem;
4648
}
4749

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

5759
.masthead p {
5860
font-size: 1.1rem;
61+
margin-bottom: 2rem;
5962
}
6063

6164
.masthead .flex {
@@ -66,7 +69,11 @@ <h1>Page Not Found</h1>
6669
.masthead .btn {
6770
width: 100%;
6871
max-width: 280px;
72+
text-align: center !important;
73+
display: flex !important;
74+
align-items: center !important;
75+
justify-content: center !important;
76+
padding: 0.75rem 1rem !important;
6977
}
7078
}
7179
</style>
72-

_layouts/default.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323

2424
<link href="/css/main.css" rel="stylesheet">
2525
<link href="/css/neovim-hi.css" rel="stylesheet">
26+
{% unless page.url == "/404.html" %}
2627
<link rel="canonical" href="{{ site.url }}{% if page.canonical_url %}{{ page.canonical_url }}{% else %}{{ page.url }}{% endif %}" />
28+
{% else %}
29+
<meta name="robots" content="noindex">
30+
{% endunless %}
2731
</head>
2832

2933
<body>

0 commit comments

Comments
 (0)