Fix: Footer fix for docs section pages, and Centralized defaultTheme in siteConfig.ts

This commit is contained in:
Wayne Sutton
2026-01-03 16:09:30 -08:00
parent 83265d5e52
commit cb2875a830
18 changed files with 115 additions and 27 deletions

15
TASK.md
View File

@@ -2,17 +2,19 @@
## To Do
- [ ] docs pages
- [ ] fix site confg link
- [ ] npm package
## Current Status
v2.8.1 ready. Centralized defaultTheme in siteConfig.ts.
v2.8.2 ready. Fixed footer not displaying on docs section pages.
## Completed
- [x] Fix footer not displaying on docs section pages with showFooter: true
- [x] Added footer.md content query to Post.tsx (matching Home.tsx and Blog.tsx pattern)
- [x] Updated all 4 Footer component calls to use `post.footer || footerPage?.content` pattern
- [x] Footer now falls back to footer.md content when no per-post footer is specified
- [x] Priority order: per-post frontmatter `footer:` > synced footer.md content > siteConfig.footer.defaultContent
- [x] Updated docs.md, files.md, changelog.md, changelog-page.md with fix documentation
- [x] Centralize defaultTheme in siteConfig.ts
- [x] Added `defaultTheme` field to siteConfig.ts (type: `Theme`)
- [x] Added `Theme` type export to siteConfig.ts
@@ -25,7 +27,6 @@ v2.8.1 ready. Centralized defaultTheme in siteConfig.ts.
- [x] Updated fork-configuration-guide.md with siteConfig.ts reference
- [x] Backward compatible: falls back to "tan" if defaultTheme not set
- [x] Docs sidebar group icons via frontmatter
- [x] Added `docsSectionGroupIcon` frontmatter field for posts and pages
- [x] Icon appears left of the group title expand/collapse chevron

View File

@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [2.8.2] - 2026-01-03
### Fixed
- Footer not displaying on docs section posts/pages even with `showFooter: true` in frontmatter
- Post.tsx now fetches footer.md content from Convex (matching Home.tsx and Blog.tsx pattern)
- Footer falls back to footer.md content when no per-post `footer:` frontmatter is specified
- Priority order: per-post frontmatter `footer:` field > synced footer.md content > siteConfig.footer.defaultContent
### Technical
- Added `useQuery(api.pages.getPageBySlug, { slug: "footer" })` to Post.tsx
- Updated all 4 Footer component calls to use `post.footer || footerPage?.content` pattern
## [2.8.1] - 2026-01-03
### Changed

View File

@@ -370,6 +370,7 @@ Your markdown content here...
| `docsSectionOrder` | No | Order within docs group. Lower numbers appear first within the group. |
| `docsSectionGroupOrder` | No | Order of the group in docs sidebar. Lower numbers make the group appear first. Groups without this field sort alphabetically. |
| `docsSectionGroupIcon` | No | Phosphor icon name for docs sidebar group (e.g., "Rocket", "Book", "PuzzlePiece"). Icon appears left of the group title. See [Phosphor Icons](https://phosphoricons.com) for available icons. |
| `docsLanding` | No | Set `true` to use as the docs landing page (shown when navigating to `/docs`). |
### How Frontmatter Works

View File

@@ -9,6 +9,7 @@ readTime: "6 min read"
image: /images/team-sync.png
featured: false
layout: "sidebar"
showFooter: true
newsletter: true
excerpt: "Learn how teams use git for markdown version control, sync to Convex deployments, and automate production workflows."
docsSection: true

View File

@@ -12,6 +12,24 @@ docsSectionOrder: 4
All notable changes to this project.
![](https://img.shields.io/badge/License-MIT-yellow.svg)
## v2.8.2
Released January 3, 2026
**Footer fix for docs section pages**
- Fixed footer not displaying on docs section posts/pages even with `showFooter: true` in frontmatter
- Post.tsx now fetches footer.md content from Convex (matching Home.tsx and Blog.tsx pattern)
- Footer falls back to footer.md content when no per-post `footer:` frontmatter is specified
- Priority order: per-post frontmatter `footer:` > synced footer.md content > siteConfig.footer.defaultContent
**Technical details:**
- Added `useQuery(api.pages.getPageBySlug, { slug: "footer" })` to Post.tsx
- Updated all 4 Footer component calls to use `post.footer || footerPage?.content` pattern
Updated files: `src/pages/Post.tsx`
## v2.8.1
Released January 3, 2026

View File

@@ -141,6 +141,7 @@ Content here...
| `docsSectionOrder` | No | Order within docs group. Lower numbers appear first within the group. |
| `docsSectionGroupOrder` | No | Order of the group in docs sidebar. Lower numbers make the group appear first. Groups without this field sort alphabetically. |
| `docsSectionGroupIcon` | No | Phosphor icon name for docs sidebar group (e.g., "Rocket", "Book", "PuzzlePiece"). Icon appears left of the group title. See [Phosphor Icons](https://phosphoricons.com) for available icons. |
| `docsLanding` | No | Set `true` to use this post as the docs landing page (shown when navigating to `/docs`). |
| `showImageAtTop` | No | Set `true` to display the `image` field at the top of the post above the header (default: `false`) |
### Static pages
@@ -189,6 +190,7 @@ Content here...
| `docsSectionOrder` | No | Order within docs group. Lower numbers appear first within the group. |
| `docsSectionGroupOrder` | No | Order of the group in docs sidebar. Lower numbers make the group appear first. Groups without this field sort alphabetically. |
| `docsSectionGroupIcon` | No | Phosphor icon name for docs sidebar group (e.g., "Rocket", "Book", "PuzzlePiece"). Icon appears left of the group title. See [Phosphor Icons](https://phosphoricons.com) for available icons. |
| `docsLanding` | No | Set `true` to use this page as the docs landing page (shown when navigating to `/docs`). |
**Hide pages from navigation:** Set `showInNav: false` to keep a page published and accessible via direct URL, but hidden from the navigation menu. Pages with `showInNav: false` remain searchable and available via API endpoints. Useful for pages you want to link directly but not show in the main nav.
@@ -259,12 +261,14 @@ Created by [Your Name](https://x.com/yourhandle). Follow on [Twitter/X](https://
2. Run `npm run sync` to sync to Convex
3. Footer content appears on homepage and blog page instantly (no rebuild needed)
3. Footer content appears on homepage, blog page, and all posts/pages instantly (no rebuild needed)
**Markdown support:** Footer content supports full markdown including links, paragraphs, line breaks, and images. External links automatically open in new tabs.
**Fallback:** If `footer` page is not found, the footer falls back to `siteConfig.footer.defaultContent`.
**Priority order:** Per-post/page frontmatter `footer:` field (custom override) > synced footer.md content > siteConfig.footer.defaultContent.
**Relationship with siteConfig:** The `content/pages/footer.md` page takes priority over `siteConfig.footer.defaultContent` when present. Use the markdown page for dynamic content that changes frequently, or keep using siteConfig for static footer content.
### Sidebar layout

View File

@@ -43,7 +43,7 @@ A brief description of each file in the codebase.
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Home.tsx` | Landing page with featured content and optional post list. Fetches home intro content from `content/pages/home.md` (slug: `home-intro`) for synced markdown intro text. Supports configurable post limit (homePostsLimit) and optional "read more" link (homePostsReadMore) via siteConfig.postsDisplay. Falls back to siteConfig.bio if home-intro page not found. Home intro content uses blog heading styles (blog-h1 through blog-h6) with clickable anchor links, matching blog post typography. Includes helper functions (generateSlug, getTextContent, HeadingAnchor) for heading ID generation and anchor links. Featured section title configurable via siteConfig.featuredTitle (default: "Get started:"). |
| `Blog.tsx` | Dedicated blog page with featured layout: hero post (first blogFeatured), featured row (remaining blogFeatured in 2 columns with excerpts), and regular posts (3 columns without excerpts). Supports list/card view toggle. Includes back button in navigation |
| `Post.tsx` | Individual blog post or page view with optional left sidebar (TOC) and right sidebar (CopyPageDropdown). Includes back button (hidden when used as homepage), tag links, related posts section in footer for blog posts, footer component with markdown support, and social footer. Supports 3-column layout at 1135px+. Can display image at top when showImageAtTop: true. Can be used as custom homepage via siteConfig.homepage (update SITE_URL/SITE_NAME when forking) |
| `Post.tsx` | Individual blog post or page view with optional left sidebar (TOC) and right sidebar (CopyPageDropdown). Includes back button (hidden when used as homepage), tag links, related posts section in footer for blog posts, footer component with markdown support (fetches footer.md content from Convex), and social footer. Supports 3-column layout at 1135px+. Can display image at top when showImageAtTop: true. Can be used as custom homepage via siteConfig.homepage (update SITE_URL/SITE_NAME when forking) |
| `Stats.tsx` | Real-time analytics dashboard with visitor stats and GitHub stars. Configurable via `siteConfig.statsPage` to enable/disable public access and navigation visibility. Shows disabled message when `enabled: false` (similar to NewsletterAdmin pattern). |
| `TagPage.tsx` | Tag archive page displaying posts filtered by a specific tag. Includes view mode toggle (list/cards) with localStorage persistence |
| `AuthorPage.tsx` | Author archive page displaying posts by a specific author. Includes view mode toggle (list/cards) with localStorage persistence. Author name clickable in posts links to this page. |
@@ -177,6 +177,7 @@ Markdown files with frontmatter for blog posts. Each file becomes a blog post.
| `docsSectionOrder` | Order within docs group (optional). Lower numbers appear first within the group. |
| `docsSectionGroupOrder` | Order of the group in docs sidebar (optional). Lower numbers make the group appear first. Groups without this field sort alphabetically. |
| `docsSectionGroupIcon` | Phosphor icon name for docs sidebar group (optional, e.g., "Rocket", "Book", "PuzzlePiece"). Icon appears left of the group title. See [Phosphor Icons](https://phosphoricons.com) for available icons. |
| `docsLanding` | Use as docs landing page (optional). Set `true` to show this post when navigating to `/docs`. |
## Static Pages (`content/pages/`)
@@ -213,6 +214,7 @@ Markdown files for static pages like About, Projects, Contact, Changelog.
| `docsSectionOrder` | Order within docs group (optional). Lower numbers appear first within the group. |
| `docsSectionGroupOrder` | Order of the group in docs sidebar (optional). Lower numbers make the group appear first. Groups without this field sort alphabetically. |
| `docsSectionGroupIcon` | Phosphor icon name for docs sidebar group (optional, e.g., "Rocket", "Book", "PuzzlePiece"). Icon appears left of the group title. See [Phosphor Icons](https://phosphoricons.com) for available icons. |
| `docsLanding` | Use as docs landing page (optional). Set `true` to show this page when navigating to `/docs`. |
## Scripts (`scripts/`)

View File

@@ -2,7 +2,7 @@
---
Type: page
Date: 2026-01-03
Date: 2026-01-04
---
An open-source publishing framework built for AI agents and developers to ship websites, docs, or blogs. Write markdown, sync from the terminal. Your content is instantly available to browsers, LLMs, and AI agents. Built on Convex and Netlify.

View File

@@ -2,12 +2,30 @@
---
Type: page
Date: 2026-01-03
Date: 2026-01-04
---
All notable changes to this project.
![](https://img.shields.io/badge/License-MIT-yellow.svg)
## v2.8.2
Released January 3, 2026
**Footer fix for docs section pages**
- Fixed footer not displaying on docs section posts/pages even with `showFooter: true` in frontmatter
- Post.tsx now fetches footer.md content from Convex (matching Home.tsx and Blog.tsx pattern)
- Footer falls back to footer.md content when no per-post `footer:` frontmatter is specified
- Priority order: per-post frontmatter `footer:` > synced footer.md content > siteConfig.footer.defaultContent
**Technical details:**
- Added `useQuery(api.pages.getPageBySlug, { slug: "footer" })` to Post.tsx
- Updated all 4 Footer component calls to use `post.footer || footerPage?.content` pattern
Updated files: `src/pages/Post.tsx`
## v2.8.1
Released January 3, 2026

View File

@@ -2,7 +2,7 @@
---
Type: page
Date: 2026-01-03
Date: 2026-01-04
---
You found the contact page. Nice

View File

@@ -2,7 +2,7 @@
---
Type: page
Date: 2026-01-03
Date: 2026-01-04
---
## Getting Started
@@ -131,6 +131,7 @@ Content here...
| `docsSectionOrder` | No | Order within docs group. Lower numbers appear first within the group. |
| `docsSectionGroupOrder` | No | Order of the group in docs sidebar. Lower numbers make the group appear first. Groups without this field sort alphabetically. |
| `docsSectionGroupIcon` | No | Phosphor icon name for docs sidebar group (e.g., "Rocket", "Book", "PuzzlePiece"). Icon appears left of the group title. See [Phosphor Icons](https://phosphoricons.com) for available icons. |
| `docsLanding` | No | Set `true` to use this post as the docs landing page (shown when navigating to `/docs`). |
| `showImageAtTop` | No | Set `true` to display the `image` field at the top of the post above the header (default: `false`) |
### Static pages
@@ -179,6 +180,7 @@ Content here...
| `docsSectionOrder` | No | Order within docs group. Lower numbers appear first within the group. |
| `docsSectionGroupOrder` | No | Order of the group in docs sidebar. Lower numbers make the group appear first. Groups without this field sort alphabetically. |
| `docsSectionGroupIcon` | No | Phosphor icon name for docs sidebar group (e.g., "Rocket", "Book", "PuzzlePiece"). Icon appears left of the group title. See [Phosphor Icons](https://phosphoricons.com) for available icons. |
| `docsLanding` | No | Set `true` to use this page as the docs landing page (shown when navigating to `/docs`). |
**Hide pages from navigation:** Set `showInNav: false` to keep a page published and accessible via direct URL, but hidden from the navigation menu. Pages with `showInNav: false` remain searchable and available via API endpoints. Useful for pages you want to link directly but not show in the main nav.
@@ -249,12 +251,14 @@ Created by [Your Name](https://x.com/yourhandle). Follow on [Twitter/X](https://
2. Run `npm run sync` to sync to Convex
3. Footer content appears on homepage and blog page instantly (no rebuild needed)
3. Footer content appears on homepage, blog page, and all posts/pages instantly (no rebuild needed)
**Markdown support:** Footer content supports full markdown including links, paragraphs, line breaks, and images. External links automatically open in new tabs.
**Fallback:** If `footer` page is not found, the footer falls back to `siteConfig.footer.defaultContent`.
**Priority order:** Per-post/page frontmatter `footer:` field (custom override) > synced footer.md content > siteConfig.footer.defaultContent.
**Relationship with siteConfig:** The `content/pages/footer.md` page takes priority over `siteConfig.footer.defaultContent` when present. Use the markdown page for dynamic content that changes frequently, or keep using siteConfig for static footer content.
### Sidebar layout

View File

@@ -2,7 +2,7 @@
---
Type: page
Date: 2026-01-03
Date: 2026-01-04
---
Built with [Convex](https://convex.dev) for real-time sync and deployed on [Netlify](https://netlify.com). Read the [project on GitHub](https://github.com/waynesutton/markdown-site) to fork and deploy your own. View [real-time site stats](/stats).

View File

@@ -2,7 +2,7 @@
---
Type: page
Date: 2026-01-03
Date: 2026-01-04
---
An open-source publishing framework built for AI agents and developers to ship **[docs](/docs)**, or **[blogs](/blog)** or **[websites](/)**.

View File

@@ -2,7 +2,7 @@
---
Type: page
Date: 2026-01-03
Date: 2026-01-04
---
# Newsletter Demo Page

View File

@@ -2,7 +2,7 @@
---
Type: page
Date: 2026-01-03
Date: 2026-01-04
---
This markdown framework is open source and built to be extended. Here is what ships out of the box.

View File

@@ -359,6 +359,7 @@ Your markdown content here...
| `docsSectionOrder` | No | Order within docs group. Lower numbers appear first within the group. |
| `docsSectionGroupOrder` | No | Order of the group in docs sidebar. Lower numbers make the group appear first. Groups without this field sort alphabetically. |
| `docsSectionGroupIcon` | No | Phosphor icon name for docs sidebar group (e.g., "Rocket", "Book", "PuzzlePiece"). Icon appears left of the group title. See [Phosphor Icons](https://phosphoricons.com) for available icons. |
| `docsLanding` | No | Set `true` to use as the docs landing page (shown when navigating to `/docs`). |
### How Frontmatter Works

View File

@@ -54,6 +54,9 @@ export default function Post({
: "skip",
);
// Fetch footer content from Convex (synced via markdown)
const footerPage = useQuery(api.pages.getPageBySlug, { slug: "footer" });
const [copied, setCopied] = useState(false);
// Scroll to hash anchor after content loads
@@ -264,7 +267,7 @@ export default function Post({
(page.showFooter !== undefined
? page.showFooter
: siteConfig.footer.showOnPages) && (
<Footer content={page.footer} />
<Footer content={page.footer || footerPage?.content} />
)}
</article>
</DocsLayout>
@@ -398,7 +401,7 @@ export default function Post({
(page.showFooter !== undefined
? page.showFooter
: siteConfig.footer.showOnPages) && (
<Footer content={page.footer} />
<Footer content={page.footer || footerPage?.content} />
)}
{/* Social footer - shown inside article at bottom for pages */}
@@ -503,7 +506,7 @@ export default function Post({
(post.showFooter !== undefined
? post.showFooter
: siteConfig.footer.showOnPosts) && (
<Footer content={post.footer} />
<Footer content={post.footer || footerPage?.content} />
)}
</article>
</DocsLayout>
@@ -632,11 +635,13 @@ export default function Post({
<p className="post-description">{post.description}</p>
)}
</header>
{/* Blog post sharing links */}
<BlogPost content={post.content} slug={post.slug} pageType="post" />
<footer className="post-footer">
<div className="post-share">
<h3 className="post-share-title">Share this post</h3>
<button
onClick={handleCopyLink}
className="share-button"
@@ -736,7 +741,7 @@ export default function Post({
(post.showFooter !== undefined
? post.showFooter
: siteConfig.footer.showOnPosts) && (
<Footer content={post.footer} />
<Footer content={post.footer || footerPage?.content} />
)}
{/* Social footer - shown inside article at bottom for posts */}

View File

@@ -1883,6 +1883,7 @@ body {
.post-share {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin-bottom: 24px;
}
@@ -1906,6 +1907,18 @@ body {
color: var(--text-primary);
}
/* Mobile: icon-only share buttons */
@media (max-width: 480px) {
.share-button {
padding: 10px;
gap: 0;
}
.share-button span {
display: none;
}
}
.post-tags {
display: flex;
flex-wrap: wrap;
@@ -1946,13 +1959,19 @@ body {
border-top: 1px solid var(--border-color);
}
.post-share-title {
width: 100%;
font-size: var(--font-size-md);
font-weight: 300;
color: var(--text-muted);
margin: 0 0 4px 0;
}
.related-posts-title {
font-size: 0.875rem;
font-weight: 600;
font-size: var(--font-size-md);
font-weight: 300;
color: var(--text-muted);
margin-bottom: 12px;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.related-posts-list {