Draft
Add configurable custom 404 page generation (GitHub Pages compatible)#29
Conversation
- Add Generate404Page property to SiteSettings (default: false) - Add NotFound to TemplateType enum - Create INotFoundProvider interface - Create PPTail.Generator.NotFound project with static HTML generator - Update Builder.cs to conditionally generate 404.html when enabled - Update SiteSettingsBuilder with Generate404Page method - Update YamlSiteSettings and Forestry SiteSettings to include Generate404Page - Update test Extensions.cs to include INotFoundProvider mock - Add comprehensive tests for 404 page generation behavior - Add NotFound project to solution file Agent-Logs-Url: https://github.com/bsstahl/PPTail/sessions/924d3052-a419-4b3a-8ce5-e713f3c7f35d Co-authored-by: bsstahl <8053235+bsstahl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bsstahl/PPTail/sessions/924d3052-a419-4b3a-8ce5-e713f3c7f35d Co-authored-by: bsstahl <8053235+bsstahl@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add a custom 404 page generation feature
Add configurable custom 404 page generation (GitHub Pages compatible)
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds opt-in generation of a static
404.htmlat the site root, compatible with GitHub Pages custom 404 page conventions. Default behavior is unchanged — the page is only generated whenGenerate404Page: trueis set in site configuration.Changes
Core model & enum
SiteSettings.Generate404Page— newboolproperty, defaults tofalseTemplateType.NotFound— new enum value to identify 404 output filesNew generator (
PPTail.Generator.NotFound)INotFoundProviderinterface withGenerate404Page()methodNotFoundProviderimplementation generates self-contained HTML from site settings (Title,Description,Copyright) with proper HTML encoding — no template required per designSite builder
Buildernow validatesINotFoundProvideris registered and conditionally emits./404.htmlwhensiteSettings.Generate404PageistrueConfiguration
YamlSiteSettings(MediaBlog) andForestry.SiteSettingsupdated to deserialize and map the new propertyEnabling the feature
In your
SiteSettings.mdYAML front matter:Tests
INotFoundProvider