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.

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