Skip to content

Conversation

@alarcritty
Copy link
Contributor

@alarcritty alarcritty commented Sep 15, 2025

Summary

Adds a custom 404 page for GitHub Pages with responsive design and mobile button alignment fixes.

Changes Made

404 Page (404.html)

  • Added custom 404 page with site styling and GitHub Pages permalink support
  • Fixed mobile button text centering and responsive layout
  • Added flexbox layout with proper spacing

Layout Updates (_layouts/default.html)

  • Added conditional canonical links for SEO
  • Added noindex meta tag for 404 page

Features

  • GitHub Pages compatible with proper permalink structure
  • Mobile optimized responsive design
  • SEO friendly with proper meta tag handling
  • Consistent with site theme and typography

Testing

  • 404 page works on desktop and mobile
  • Non-existent routes redirect to custom 404 page
  • Button alignment is correct on all screen sizes
2025-09-15_14-43

alarcritty and others added 8 commits September 12, 2025 15:27
- Integrates with existing Jekyll layout system
- Matches site color scheme and navigation
- Provides helpful links for users
- Includes auto-redirect for common typos
- 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
- 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
@alarcritty
Copy link
Contributor Author

Hey @justinmk , take a look at this , it's working now .

@justinmk
Copy link
Member

Thanks!

Feedback for future work: after all the words in this PR, I don't get the one explanation I actually need, which is how do the changes in _layouts/default.html fix a problem. That's why I always recommend PR and commit messages have a Problem/Solution layout.

The current PR description is a long list of things that happened, but no idea which ones solve which problem.

Comment on lines +26 to 27
{% unless page.url == "/404.html" %}
<link rel="canonical" href="{{ site.url }}{% if page.canonical_url %}{{ page.canonical_url }}{% else %}{{ page.url }}{% endif %}" />
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

@justinmk justinmk changed the title Add Custom 404 Page with GitHub Pages Support and Mobile Optimization skip <link rel="canonical"> for 404 page Sep 15, 2025
@justinmk justinmk changed the title skip <link rel="canonical"> for 404 page skip <link rel="canonical"> for 404 page Sep 15, 2025
@justinmk justinmk merged commit 99f6e48 into neovim:master Sep 15, 2025
@alarcritty
Copy link
Contributor Author

Thanks!

Feedback for future work: after all the words in this PR, I don't get the one explanation I actually need, which is how do the changes in _layouts/default.html fix a problem. That's why I always recommend PR and commit messages have a Problem/Solution layout.

The current PR description is a long list of things that happened, but no idea which ones solve which problem.

Thanks for the feedback! You're absolutely right - I should have clearly explained how the _layouts/default.html changes solve the specific problem. I'll make sure future PRs follow a Problem/Solution structure so the 'why' behind each change is clear upfront.

@alarcritty
Copy link
Contributor Author

hey @justinmk , Should the footer sit directly at the bottom of the page with no extra spacing below it, and without triggering a scrollbar? Just want to confirm the expected behavior before making further adjustments.

@justinmk
Copy link
Member

justinmk commented Nov 26, 2025

https://neovim.io/about/ works the same way. I don't think 404 page should have a custom footer behavior.

Perhaps a bit of padding should be added above the footer, but not very much. Showing scrollbars on 13-inch laptops is a pretty bad tradeoff just to fix this other "problem" on bigger screens.

If CSS has a simple way to add padding for bigger screens, but reduce padding for smaller screens, then sure.

@alarcritty
Copy link
Contributor Author

Got it! I'll add responsive padding that only applies on larger screens to avoid the scrollbar issue on smaller devices. I'll use a media query to keep it minimal on laptops while fixing the spacing on larger displays.

@justinmk
Copy link
Member

justinmk commented Nov 26, 2025

Is a media query actually needed or is there a CSS property like max-padding or min-margin (or whatever), which only adds padding if there is room to do so?

@alarcritty
Copy link
Contributor Author

I don't think CSS has max-padding or min-padding properties. A media query seems to be the standard approach for this.
Also, I noticed this spacing issue exists on other pages with less content too (not just the 404 page). Should I update the footer layout itself to fix it across all pages, or just handle it individually for each page?

@justinmk
Copy link
Member

I don't think 404 page should have a custom footer behavior.

^

@alarcritty
Copy link
Contributor Author

So should I make the changes directly to the main footer component, or is there a different approach you'd prefer for fixing this?

@justinmk
Copy link
Member

All pages should have the same footer behavior

@alarcritty
Copy link
Contributor Author

understood!

@alarcritty
Copy link
Contributor Author

hey @justinmk ,

I've made some updates to the main.css file to fix the footer positioning on pages with minimal content (like the 404 page). Added flexbox layout to ensure the footer stays at the bottom of the viewport across all screen sizes without affecting the existing design.

Here are the changes:

html {
  height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

body > nav {
  flex-shrink: 0;
}

body > main {
  flex: 1 0 auto;
}

body > footer {
  flex-shrink: 0;
  margin-top: auto;
}

the final result:
Screenshot 2025-11-29 at 10 46 11 AM

If you'd like any refinements or adjustments, just let me know. If everything looks good, I'll go ahead and open the pull request.

@justinmk
Copy link
Member

LGTM thanks

@alarcritty
Copy link
Contributor Author

done , here you go :
#418

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants