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 <noreply@anthropic.com>
This commit is contained in:
Wayne Sutton
2026-01-06 11:31:55 -08:00
parent 85c100451a
commit 98916899a3
12 changed files with 317 additions and 32 deletions

12
TASK.md
View File

@@ -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)