Skip to content

feat: Generate tag list pages#79

Merged
justinyoo merged 6 commits intovnextfrom
copilot/generate-tag-list-pages
Jan 5, 2026
Merged

feat: Generate tag list pages#79
justinyoo merged 6 commits intovnextfrom
copilot/generate-tag-list-pages

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 4, 2026

Blog posts and pages can have tags in their front matter, but there was no way to browse content by tag. This adds automatic generation of /tags (listing all tags) and /tags/{tag} (listing content for a specific tag) pages during static site build.

Changes

  • Theme base classes: Added TagListViewBase and TagViewBase for theme customization
  • Default theme: Added TagListView.razor and TagView.razor templates
  • Generator: Added RenderTagPagesAsync to StaticSiteGenerator that:
    • Groups documents by tag (lowercase normalized)
    • Sorts posts by publish date (descending), pages by title (ascending)
    • Skips tag page generation if no documents have tags
  • API: Extended IStaticSiteGenerator.BuildAsync and AddLayouts to require TTagListView and TTagView type parameters

Usage

new ScissorHandsApplicationBuilder(args)
    .AddLayouts<MainLayout, IndexView, PostView, PageView, NotFoundView, TagListView, TagView>()
    .Build()
    .RunAsync();

Output Structure

/tags/index.html           # All tags with their posts/pages
/tags/blazor/index.html    # Posts and pages tagged "blazor"
/tags/azure/index.html     # Posts and pages tagged "azure"

Posts and pages are listed separately within each tag section. Empty sections are omitted.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature]: Generate tag list pages</issue_title>
<issue_description>### Background

Each blog post has the front matter section that contains the list of tags. When each blog post is generated as an HTML, it displays the tags. However, there's no way to see the list of blog posts having the same tag in a collective way.

Describe the Feature

When HTML pages are generated, it should also generate the page for each tag. And each tag page should display the list of blog posts in a reverse chronological order, and pages in order of page title.

For example, there are two blog posts and one page:

  • a blog post "hello-world" published on 2025-12-31 contains both tags of blazor and azure in its front matter section.
  • another blog post "lorem-ipsum" published on 2026-01-03 contains both tags of asp-net and azure in its front matter section.
  • a page "getting-started" contains blazor in its front matter section.

Now, when ScissorHands.NET generates the HTML pages, it should generates additional pages like:

  • /tags: List all the tags that set as sections and all blog posts and pages having the tag under the section. Blog posts and pages should be listed separately. If there's only blog posts available, do not display the page section, and vice versa.
  • /tags/asp-net: List all blog posts and pages having the tag of asp-net. Blog posts and pages should be listed separately. If there's only blog posts available, do not display the page section, and vice versa.
  • /tags/azure: List all blog posts and pages having the tag of azure. Blog posts and pages should be listed separately. If there's only blog posts available, do not display the page section, and vice versa.
  • /tags/blazor: List all blog posts and pages having the tag of blazor. Blog posts and pages should be listed separately. If there's only blog posts available, do not display the page section, and vice versa.

Alternatives Considered

No response

Screenshots

No response

Additional Context

No response</issue_description>

Comments on the Issue (you are @copilot in this section)

Custom agent used: Expert .NET software engineer mode instructions
Provide expert .NET software engineering guidance using modern software design patterns.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Add TagListViewBase and TagViewBase base classes in ScissorHands.Theme
- Add TagListView.razor and TagView.razor in default theme
- Update CascadingMainLayoutBase with tag-related cascading parameters
- Update MainLayoutBase with tag-related parameters
- Update IStaticSiteGenerator interface to include TTagListView and TTagView type parameters
- Update StaticSiteGenerator with RenderTagPagesAsync methods
- Update ScissorHandsApplication and ScissorHandsApplicationBuilder for 7 type parameters
- Add unit tests for tag page generation

Co-authored-by: justinyoo <1538528+justinyoo@users.noreply.github.com>
Copilot AI changed the title [WIP] Add feature to generate tag list pages feat: Generate tag list pages Jan 4, 2026
Copilot AI requested a review from justinyoo January 4, 2026 05:11
@justinyoo justinyoo marked this pull request as ready for review January 5, 2026 02:40
@justinyoo justinyoo merged commit 7242fa4 into vnext Jan 5, 2026
4 checks passed
@justinyoo justinyoo deleted the copilot/generate-tag-list-pages branch January 5, 2026 02:42
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.

[Feature]: Generate tag list pages

2 participants