Skip to content

Add HeadingSummary plugin for extracting article headings as navigation metadata#8

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/extract-blog-article-headings
Draft

Add HeadingSummary plugin for extracting article headings as navigation metadata#8
Copilot wants to merge 2 commits intomainfrom
copilot/extract-blog-article-headings

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 14, 2026

Implements a new HeadingSummary plugin that parses post HTML and stores a structured list of headings as document metadata, enabling in-page navigation (table of contents, sidebars, etc.).

New plugin: HeadingSummary

  • Heading.cs — Data model with Level (int), Id (string?), Text (string?)
  • HeadingSummaryModule.csParallelModule using HtmlAgilityPack to select h1h6 nodes and emit a List<Heading> under the "Headings" metadata key
  • HeadingSummaryConfigurator.csIConfigurator<Bootstrapper> that inserts the module into the Content pipeline at position 3, matching the ReadingTime pattern

Sample updates

  • 1.md — headings promoted to proper markdown with {#anchor-id} syntax
  • _sidebar.cshtml — renders Headings as a navigation <ul> with anchor links

Usage

Add headings with IDs in your markdown:

## My Section {#my-section}

Render in a template:

@{
    var headings = Model.GetList<Statiq.Plugins.Heading>("Headings");
}
@foreach (var heading in headings)
{
    <li class="heading-level-@heading.Level">
        <a href="#@heading.Id">@heading.Text</a>
    </li>
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • blog.jermdavis.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Heading Summary</issue_title>
<issue_description>Extracting blog article headings for navigation from @ Jeremy Davis

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


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: AlexHedley <1573469+AlexHedley@users.noreply.github.com>
Copilot AI changed the title [WIP] Extract blog article headings for navigation Add HeadingSummary plugin for extracting article headings as navigation metadata Mar 14, 2026
Copilot AI requested a review from AlexHedley March 14, 2026 09:34
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.

Heading Summary

2 participants