Skip to content

[#235] Add a custom 404 page - #241

Merged
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:custom-404-page
Oct 1, 2026
Merged

vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:custom-404-page

Conversation

@vharseko

Copy link
Copy Markdown
Member

Summary

The site had no 404.html, so any broken or mistyped URL showed the generic GitHub Pages "404 — File not found" page with no way back into the site.

  • 404.html — a new page on layout: home (navbar, footer, cookie notice) with permalink: /404.html. It explains that old blog / GitHub wiki links have most likely moved to the blog, and links to Home, Blog, Documentation, Support, GitHub Discussions and every product page (taken from _data/products.yml, the same source as the Products menu). All links are absolute, so the page works when GitHub Pages serves it under any nested URL.
  • sitemap.xml — pages with sitemap: false are skipped; the 404 page uses it.
  • _includes/header.html — renders <meta name="robots"> when a page sets robots:; the 404 page sets noindex, since /404.html itself is served with status 200 when requested directly. No other page sets it, so their output is unchanged.

Fixes #235

Verification

Built the site with bundle exec jekyll build (Ruby 3.1, as in CI) and ran the same htmlproofer internal-link check as the workflow: 375 files, no errors.

  • _site/404.html: <title>Page Not Found · Open Identity Platform</title>, <meta name="robots" content="noindex">, navbar and footer present, five product links.
  • /404 is not in sitemap.xml.
  • /, /openam and a blog post have no robots meta tag, as before.

- Add 404.html on the home layout with links to Home, Blog,
  Documentation, Support, GitHub Discussions and the product pages
  (Fixes OpenIdentityPlatform#235)
- Skip pages with sitemap: false in sitemap.xml
- Render <meta name="robots"> from page.robots, used as noindex on the
  404 page
@vharseko vharseko added the enhancement New feature or request label Sep 30, 2026
@vharseko vharseko added the enhancement New feature or request label Sep 30, 2026

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

praise: The change is small, sits where each behaviour lives, and leaves every other page's output unchanged.

  • sitemap.xml:29 — page.sitemap != false is true for every page without the key (Liquid 4 != is !(nil == false)), so only the 404 page drops out of the sitemap.
  • _includes/header.html:25-27 — {%- if page.robots %} / {%- endif %} trim exactly the newline they stand in for, so the head of a page without robots: renders as at base.
  • 404.html:42-44 — the product links come from site.data.products, the same source as the Products menu, so the page cannot drift from the navbar.

@vharseko
vharseko merged commit 205558e into OpenIdentityPlatform:master Oct 1, 2026
1 check passed
@vharseko
vharseko deleted the custom-404-page branch October 1, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a custom 404 page

2 participants