From 98916899a3162527bd7fe75e4c302785ace75e76 Mon Sep 17 00:00:00 2001 From: Wayne Sutton Date: Tue, 6 Jan 2026 11:31:55 -0800 Subject: [PATCH] fix(seo): resolve 7 SEO issues from GitHub Issue #4 SEO improvements for better search engine optimization: 1. Canonical URL - Added client-side dynamic canonical link tags for posts and pages 2. Single H1 per page - Markdown H1s demoted to H2 with .blog-h1-demoted class (maintains H1 visual styling) 3. DOM order fix - Article now loads before sidebar in DOM for SEO (CSS order property maintains visual layout) 4. X-Robots-Tag - HTTP header added via netlify.toml (index, follow for public; noindex for dashboard/api routes) 5. Hreflang tags - Self-referencing hreflang (en, x-default) for language targeting 6. og:url consistency - Uses same canonicalUrl variable as canonical link tag 7. twitter:site - New TwitterConfig in siteConfig.ts for Twitter Cards meta tags Files modified: - src/config/siteConfig.ts: Added TwitterConfig interface with site/creator fields - src/pages/Post.tsx: SEO meta tags for posts/pages, DOM order optimization - src/components/BlogPost.tsx: H1 to H2 demotion in markdown renderer - src/styles/global.css: .blog-h1-demoted class, CSS order properties - convex/http.ts: hreflang and twitter:site in generateMetaHtml() - netlify.toml: X-Robots-Tag headers for public, dashboard, API routes - index.html: canonical, hreflang, twitter:site placeholder tags - fork-config.json.example: twitter configuration fields Closes #4 Co-Authored-By: Claude Opus 4.5 --- TASK.md | 12 ++- changelog.md | 25 +++++ content/pages/changelog-page.md | 29 ++++++ convex/http.ts | 8 +- files.md | 10 +- fork-config.json.example | 4 + index.html | 10 ++ netlify.toml | 13 +++ src/components/BlogPost.tsx | 12 ++- src/config/siteConfig.ts | 18 ++++ src/pages/Post.tsx | 179 ++++++++++++++++++++++++++++---- src/styles/global.css | 29 ++++++ 12 files changed, 317 insertions(+), 32 deletions(-) diff --git a/TASK.md b/TASK.md index edb1064..8136688 100644 --- a/TASK.md +++ b/TASK.md @@ -4,10 +4,20 @@ ## Current Status -v2.10.1 ready. Semantic search now optional via siteConfig.semanticSearch.enabled toggle. +v2.10.2 ready. SEO fixes from GitHub Issue #4 implemented. ## Completed +- [x] SEO fixes for GitHub Issue #4 (7 issues) + - [x] Canonical URL: Dynamic canonical link tags for posts and pages in Post.tsx + - [x] Single H1 per page: Markdown H1s demoted to H2 with `.blog-h1-demoted` class in BlogPost.tsx + - [x] DOM order fix: Article before sidebar in DOM, CSS `order` for visual positioning + - [x] X-Robots-Tag: HTTP header in netlify.toml (index for public, noindex for dashboard/api) + - [x] Hreflang tags: Self-referencing hreflang (en, x-default) in index.html, Post.tsx, http.ts + - [x] og:url consistency: Uses same canonicalUrl variable as canonical link + - [x] twitter:site: New TwitterConfig in siteConfig.ts with site and creator fields + - [x] Updated fork-config.json.example with twitter configuration + - [x] Optional semantic search configuration - [x] Added `SemanticSearchConfig` interface to `siteConfig.ts` - [x] Added `semanticSearch.enabled` toggle (default: false to avoid blocking forks) diff --git a/changelog.md b/changelog.md index bc13cf6..c267ccd 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,31 @@ 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.10.2] - 2026-01-06 + +### Added + +- SEO fixes for GitHub Issue #4 (7 issues resolved) + - Canonical URL: Client-side dynamic canonical link tags for posts and pages + - Single H1 per page: Markdown H1s demoted to H2 (`.blog-h1-demoted` class with H1 visual styling) + - DOM order fix: Article loads before sidebar in DOM for SEO (CSS `order` property maintains visual layout) + - X-Robots-Tag: HTTP header added via netlify.toml (`index, follow` for public, `noindex` for dashboard/api) + - Hreflang tags: Self-referencing hreflang (en, x-default) for all pages + - og:url consistency: Uses same canonicalUrl variable as canonical link + - twitter:site meta tag: New TwitterConfig in siteConfig.ts for Twitter Cards + +### Technical + +- New `TwitterConfig` interface in `src/config/siteConfig.ts` with site and creator fields +- Updated `src/pages/Post.tsx` with SEO meta tags for both posts and pages (canonical, hreflang, og:url, twitter) +- Updated `src/pages/Post.tsx` DOM order: article before sidebar with CSS order for visual positioning +- Updated `src/components/BlogPost.tsx` h1 renderer outputs h2 with `.blog-h1-demoted` class +- Updated `src/styles/global.css` with `.blog-h1-demoted` styling and CSS order properties for sidebar +- Updated `convex/http.ts` generateMetaHtml() with hreflang and twitter:site tags +- Updated `netlify.toml` with X-Robots-Tag headers for public, dashboard, and API routes +- Updated `index.html` with canonical, hreflang, and twitter:site placeholder tags +- Updated `fork-config.json.example` with twitter configuration fields + ## [2.10.1] - 2026-01-05 ### Added diff --git a/content/pages/changelog-page.md b/content/pages/changelog-page.md index 00d2455..a8391e9 100644 --- a/content/pages/changelog-page.md +++ b/content/pages/changelog-page.md @@ -11,6 +11,35 @@ docsSectionOrder: 4 All notable changes to this project. +## v2.10.2 + +Released January 6, 2026 + +**SEO fixes for GitHub Issue #4** + +Seven SEO issues resolved to improve search engine optimization: + +1. **Canonical URL** - Dynamic canonical link tags added client-side for posts and pages +2. **Single H1 per page** - Markdown H1s demoted to H2 elements with `.blog-h1-demoted` class (maintains H1 visual styling) +3. **DOM order fix** - Article now loads before sidebar in DOM for better SEO (CSS `order` property maintains visual layout) +4. **X-Robots-Tag** - HTTP header added via netlify.toml (public routes indexed, dashboard/API routes noindexed) +5. **Hreflang tags** - Self-referencing hreflang (en, x-default) for language targeting +6. **og:url consistency** - Uses same canonicalUrl variable as canonical link tag +7. **twitter:site** - New `TwitterConfig` in siteConfig.ts for Twitter Cards + +**Configuration:** + +Add your Twitter handle in `src/config/siteConfig.ts`: + +```typescript +twitter: { + site: "@yourhandle", + creator: "@yourhandle", +}, +``` + +**Updated files:** `src/config/siteConfig.ts`, `src/pages/Post.tsx`, `src/components/BlogPost.tsx`, `src/styles/global.css`, `convex/http.ts`, `netlify.toml`, `index.html`, `fork-config.json.example` + ## v2.10.1 Released January 5, 2026 diff --git a/convex/http.ts b/convex/http.ts index d70f4ad..156044e 100644 --- a/convex/http.ts +++ b/convex/http.ts @@ -302,12 +302,18 @@ function generateMetaHtml(content: { : "" } + + + + - + + +