Content Audit

Last updated: 03/06/2026Edit this page

Trellis Docs includes a built-in script that exports your entire documentation inventory as a CSV file. No external tools or plugins required.

Running the export

# Print to terminal
node scripts/export-sidebar.js

# Save to a file
node scripts/export-sidebar.js > sidebar.csv

The script reads your config/sidebar.ts and every doc's frontmatter, then outputs a single CSV with one row per page.

Output columns

ColumnSourceDescription
Doc IDSidebar configThe sidebar item id (e.g., guides/docs)
TitleFrontmatter title or sidebar labelDisplay title of the page
URLDerived from IDPublished URL path (e.g., /guides/docs/)
CategorySidebar structureParent category chain (e.g., Guides > Markdown)
DraftFrontmatter draftYes if the page is marked as a draft
Doc TypeFrontmatter doc_typehow-to, concept, reference, or tutorial
RoleFrontmatter roleTarget audience tags (e.g., Developer; Admin)
Last UpdatedFrontmatter last_update.dateDate the page was last revised
AuthorFrontmatter last_update.authorWho last updated the page
DescriptionFrontmatter descriptionShort description used in search and SEO
KeywordsFrontmatter keywordsSearch keywords, semicolon-separated
File PathFilesystemRelative path to the source file

Example output

Doc ID,Title,URL,Category,Draft,Doc Type,Role,Last Updated,Author,Description,Keywords,File Path
introduction,Introduction,/introduction/,,,,,,Overview of Trellis Docs.,trellis; docs; introduction,content/docs/introduction.mdx
guides/docs,Docs,/guides/docs/,Guides,,,Developer,03/04/2026,Trellis,Create doc pages and configure frontmatter.,docs; frontmatter; sidebar,content/docs/guides/docs.mdx

Use cases

Content gap analysis

Filter the CSV by Doc Type to see if your docs cover all four types — how-to, concept, reference, and tutorial. A product with only reference docs is missing onboarding material.

Stale content review

Sort by Last Updated to find pages that haven't been revised recently. Pages without a last_update date show up as blank — those are your first candidates.

Draft tracking

Filter Draft = Yes to see pages that exist in source control but are excluded from search, navigation, and the FAQ index.

Audience coverage

Group by Role to check whether your docs address all target audiences. If every page is tagged Developer but none say Admin, administrators are underserved.

Stakeholder reporting

Open the CSV in Excel or Google Sheets and share it with content managers, product owners, or compliance teams who need a full inventory without access to the codebase.

How it works

The script:

  1. Parses config/sidebar.ts to get the full sidebar tree
  2. For each sidebar item, finds the corresponding .mdx or .md file in content/docs/
  3. Reads the YAML frontmatter with gray-matter
  4. Flattens the sidebar hierarchy into rows, preserving the category chain
  5. Outputs RFC 4180-compliant CSV to stdout

Categories in the sidebar create a breadcrumb-style chain in the Category column (e.g., Guides > Markdown > Code Blocks). If a category links to its own page, that page gets its own row.

Pages referenced in the sidebar but missing from the filesystem show (not found) in the File Path column — useful for catching broken sidebar references.


Was this page helpful?