diff --git a/FORK_CONFIG.md b/FORK_CONFIG.md index 0fa3855..5360dca 100644 --- a/FORK_CONFIG.md +++ b/FORK_CONFIG.md @@ -61,7 +61,8 @@ This updates all 11 configuration files automatically: - `public/robots.txt` - `public/openapi.yaml` - `public/.well-known/ai-plugin.json` -- `src/context/ThemeContext.tsx` + +Theme is now configured in `src/config/siteConfig.ts` (via the `defaultTheme` field). ### Step 4: Review and deploy @@ -92,7 +93,7 @@ Edit each file individually following the guide below. | `public/robots.txt` | Sitemap URL | | `public/openapi.yaml` | Server URL, site name | | `public/.well-known/ai-plugin.json` | Plugin metadata | -| `src/context/ThemeContext.tsx` | Default theme | +| `src/config/siteConfig.ts` | Default theme (`defaultTheme` field) | --- @@ -423,12 +424,15 @@ Update plugin metadata: } ``` -### 11. src/context/ThemeContext.tsx +### 11. Default Theme (in siteConfig.ts) -Change the default theme (line 21): +Change the default theme in `src/config/siteConfig.ts`: ```typescript -const DEFAULT_THEME: Theme = "tan"; // Options: dark, light, tan, cloud +export const siteConfig: SiteConfig = { + // ... other config + defaultTheme: "tan", // Options: "dark", "light", "tan", "cloud" +}; ``` --- diff --git a/TASK.md b/TASK.md index 874ffbd..ae9de97 100644 --- a/TASK.md +++ b/TASK.md @@ -9,10 +9,23 @@ ## Current Status -v2.8.0 ready. Docs sidebar group icons via frontmatter. +v2.8.1 ready. Centralized defaultTheme in siteConfig.ts. ## Completed +- [x] Centralize defaultTheme in siteConfig.ts + - [x] Added `defaultTheme` field to siteConfig.ts (type: `Theme`) + - [x] Added `Theme` type export to siteConfig.ts + - [x] Updated ThemeContext.tsx to import and use siteConfig.defaultTheme + - [x] Updated configure-fork.ts to update siteConfig.ts instead of ThemeContext.tsx + - [x] Renamed `updateThemeContext` to `updateThemeConfig` in configure-fork.ts + - [x] Updated docs.md Theme section with new siteConfig.ts example + - [x] Updated setup-guide.md "Change the Default Theme" section + - [x] Updated FORK_CONFIG.md with new theme configuration instructions + - [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 diff --git a/changelog.md b/changelog.md index c783a91..6233f01 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,24 @@ 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.1] - 2026-01-03 + +### Changed + +- Centralized `defaultTheme` configuration in `siteConfig.ts` + - Theme is now configured via `defaultTheme` field in siteConfig instead of ThemeContext.tsx + - ThemeContext.tsx now imports and uses `siteConfig.defaultTheme` with fallback to "tan" + - Fork configuration script (`configure-fork.ts`) now updates siteConfig.ts for theme changes + - Backward compatible: existing sites work without changes + +### Technical + +- Added `Theme` type export to `src/config/siteConfig.ts` +- Added `defaultTheme?: Theme` field to SiteConfig interface +- Updated `src/context/ThemeContext.tsx` to import from siteConfig +- Renamed `updateThemeContext` to `updateThemeConfig` in `scripts/configure-fork.ts` +- Updated documentation: `docs.md`, `setup-guide.md`, `FORK_CONFIG.md`, `fork-configuration-guide.md` + ## [2.8.0] - 2026-01-03 ### Added diff --git a/content/blog/fork-configuration-guide.md b/content/blog/fork-configuration-guide.md index 874eb9d..745fa19 100644 --- a/content/blog/fork-configuration-guide.md +++ b/content/blog/fork-configuration-guide.md @@ -84,7 +84,7 @@ Updating public/llms.txt... Updating public/robots.txt... Updating public/openapi.yaml... Updating public/.well-known/ai-plugin.json... -Updating src/context/ThemeContext.tsx... +Updating default theme in src/config/siteConfig.ts... Configuration complete! ``` @@ -113,7 +113,7 @@ The configuration script updates these files: | `public/robots.txt` | Sitemap URL | | `public/openapi.yaml` | Server URL, site name | | `public/.well-known/ai-plugin.json` | Plugin metadata | -| `src/context/ThemeContext.tsx` | Default theme | +| `src/config/siteConfig.ts` | Default theme (`defaultTheme` field) | ## Optional settings diff --git a/content/blog/setup-guide.md b/content/blog/setup-guide.md index 34e8d1d..4bfe7c5 100644 --- a/content/blog/setup-guide.md +++ b/content/blog/setup-guide.md @@ -551,7 +551,7 @@ Follow the step-by-step guide in `FORK_CONFIG.md` to update each file manually. | `public/robots.txt` | Sitemap URL and header comment | | `public/openapi.yaml` | API title, server URL, site name in examples | | `public/.well-known/ai-plugin.json` | Site name, descriptions | -| `src/context/ThemeContext.tsx` | Default theme | +| `src/config/siteConfig.ts` | Default theme (`defaultTheme` field) | ### Site title and description metadata @@ -992,10 +992,13 @@ The button uses Phosphor ArrowUp icon and works with all four themes. It uses a ### Change the Default Theme -Edit `src/context/ThemeContext.tsx`: +Configure in `src/config/siteConfig.ts`: ```typescript -const DEFAULT_THEME: Theme = "tan"; // Options: "dark", "light", "tan", "cloud" +export const siteConfig: SiteConfig = { + // ... other config + defaultTheme: "tan", // Options: "dark", "light", "tan", "cloud" +}; ``` ### Change the Font diff --git a/content/pages/changelog-page.md b/content/pages/changelog-page.md index 5e3482f..805bc1d 100644 --- a/content/pages/changelog-page.md +++ b/content/pages/changelog-page.md @@ -12,6 +12,36 @@ docsSectionOrder: 4 All notable changes to this project. ![](https://img.shields.io/badge/License-MIT-yellow.svg) +## v2.8.1 + +Released January 3, 2026 + +**Centralized defaultTheme in siteConfig.ts** + +- Theme configuration moved from ThemeContext.tsx to siteConfig.ts +- New `defaultTheme` field in siteConfig for centralized theme management +- ThemeContext.tsx now imports theme setting from siteConfig +- Fork configuration script updated to modify siteConfig.ts +- Backward compatible: falls back to "tan" if defaultTheme not set + +**Configuration example:** + +```typescript +export const siteConfig: SiteConfig = { + // ... other config + defaultTheme: "tan", // Options: "dark", "light", "tan", "cloud" +}; +``` + +**Technical details:** + +- Added `Theme` type export to `src/config/siteConfig.ts` +- Added `defaultTheme?: Theme` field to SiteConfig interface +- Updated `src/context/ThemeContext.tsx` to import from siteConfig +- Renamed `updateThemeContext` to `updateThemeConfig` in `scripts/configure-fork.ts` + +Updated files: `src/config/siteConfig.ts`, `src/context/ThemeContext.tsx`, `scripts/configure-fork.ts`, `content/pages/docs.md`, `content/blog/setup-guide.md`, `FORK_CONFIG.md`, `content/blog/fork-configuration-guide.md` + ## v2.8.0 Released January 3, 2026 diff --git a/content/pages/docs.md b/content/pages/docs.md index d26ed0f..b809b25 100644 --- a/content/pages/docs.md +++ b/content/pages/docs.md @@ -462,7 +462,7 @@ Follow the step-by-step guide in `FORK_CONFIG.md` to update each file manually. | `public/robots.txt` | Sitemap URL and header comment | | `public/openapi.yaml` | API title, server URL, site name in examples | | `public/.well-known/ai-plugin.json` | Site name, descriptions | -| `src/context/ThemeContext.tsx` | Default theme | +| `src/config/siteConfig.ts` | Default theme (`defaultTheme` field) | ### Site title and description metadata @@ -780,10 +780,13 @@ Uses Phosphor ArrowUp icon and works with all themes. Default: `tan`. Options: `dark`, `light`, `tan`, `cloud`. -Edit `src/context/ThemeContext.tsx`: +Configure in `src/config/siteConfig.ts`: ```typescript -const DEFAULT_THEME: Theme = "tan"; +export const siteConfig: SiteConfig = { + // ... other config + defaultTheme: "tan", +}; ``` ### Font diff --git a/public/raw/changelog.md b/public/raw/changelog.md index 6f48798..dc58120 100644 --- a/public/raw/changelog.md +++ b/public/raw/changelog.md @@ -8,6 +8,36 @@ Date: 2026-01-03 All notable changes to this project. ![](https://img.shields.io/badge/License-MIT-yellow.svg) +## v2.8.1 + +Released January 3, 2026 + +**Centralized defaultTheme in siteConfig.ts** + +- Theme configuration moved from ThemeContext.tsx to siteConfig.ts +- New `defaultTheme` field in siteConfig for centralized theme management +- ThemeContext.tsx now imports theme setting from siteConfig +- Fork configuration script updated to modify siteConfig.ts +- Backward compatible: falls back to "tan" if defaultTheme not set + +**Configuration example:** + +```typescript +export const siteConfig: SiteConfig = { + // ... other config + defaultTheme: "tan", // Options: "dark", "light", "tan", "cloud" +}; +``` + +**Technical details:** + +- Added `Theme` type export to `src/config/siteConfig.ts` +- Added `defaultTheme?: Theme` field to SiteConfig interface +- Updated `src/context/ThemeContext.tsx` to import from siteConfig +- Renamed `updateThemeContext` to `updateThemeConfig` in `scripts/configure-fork.ts` + +Updated files: `src/config/siteConfig.ts`, `src/context/ThemeContext.tsx`, `scripts/configure-fork.ts`, `content/pages/docs.md`, `content/blog/setup-guide.md`, `FORK_CONFIG.md`, `content/blog/fork-configuration-guide.md` + ## v2.8.0 Released January 3, 2026 diff --git a/public/raw/documentation.md b/public/raw/documentation.md index c756e16..e3fa98d 100644 --- a/public/raw/documentation.md +++ b/public/raw/documentation.md @@ -452,7 +452,7 @@ Follow the step-by-step guide in `FORK_CONFIG.md` to update each file manually. | `public/robots.txt` | Sitemap URL and header comment | | `public/openapi.yaml` | API title, server URL, site name in examples | | `public/.well-known/ai-plugin.json` | Site name, descriptions | -| `src/context/ThemeContext.tsx` | Default theme | +| `src/config/siteConfig.ts` | Default theme (`defaultTheme` field) | ### Site title and description metadata @@ -770,10 +770,13 @@ Uses Phosphor ArrowUp icon and works with all themes. Default: `tan`. Options: `dark`, `light`, `tan`, `cloud`. -Edit `src/context/ThemeContext.tsx`: +Configure in `src/config/siteConfig.ts`: ```typescript -const DEFAULT_THEME: Theme = "tan"; +export const siteConfig: SiteConfig = { + // ... other config + defaultTheme: "tan", +}; ``` ### Font diff --git a/public/raw/fork-configuration-guide.md b/public/raw/fork-configuration-guide.md index cd683b4..7f55338 100644 --- a/public/raw/fork-configuration-guide.md +++ b/public/raw/fork-configuration-guide.md @@ -74,7 +74,7 @@ Updating public/llms.txt... Updating public/robots.txt... Updating public/openapi.yaml... Updating public/.well-known/ai-plugin.json... -Updating src/context/ThemeContext.tsx... +Updating default theme in src/config/siteConfig.ts... Configuration complete! ``` @@ -103,7 +103,7 @@ The configuration script updates these files: | `public/robots.txt` | Sitemap URL | | `public/openapi.yaml` | Server URL, site name | | `public/.well-known/ai-plugin.json` | Plugin metadata | -| `src/context/ThemeContext.tsx` | Default theme | +| `src/config/siteConfig.ts` | Default theme (`defaultTheme` field) | ## Optional settings diff --git a/public/raw/setup-guide.md b/public/raw/setup-guide.md index 35c4e28..7f35140 100644 --- a/public/raw/setup-guide.md +++ b/public/raw/setup-guide.md @@ -540,7 +540,7 @@ Follow the step-by-step guide in `FORK_CONFIG.md` to update each file manually. | `public/robots.txt` | Sitemap URL and header comment | | `public/openapi.yaml` | API title, server URL, site name in examples | | `public/.well-known/ai-plugin.json` | Site name, descriptions | -| `src/context/ThemeContext.tsx` | Default theme | +| `src/config/siteConfig.ts` | Default theme (`defaultTheme` field) | ### Site title and description metadata @@ -981,10 +981,13 @@ The button uses Phosphor ArrowUp icon and works with all four themes. It uses a ### Change the Default Theme -Edit `src/context/ThemeContext.tsx`: +Configure in `src/config/siteConfig.ts`: ```typescript -const DEFAULT_THEME: Theme = "tan"; // Options: "dark", "light", "tan", "cloud" +export const siteConfig: SiteConfig = { + // ... other config + defaultTheme: "tan", // Options: "dark", "light", "tan", "cloud" +}; ``` ### Change the Font diff --git a/scripts/configure-fork.ts b/scripts/configure-fork.ts index ae13163..51e1659 100644 --- a/scripts/configure-fork.ts +++ b/scripts/configure-fork.ts @@ -809,16 +809,16 @@ function updateAiPluginJson(config: ForkConfig): void { console.log(` Updated: public/.well-known/ai-plugin.json`); } -// Update src/context/ThemeContext.tsx -function updateThemeContext(config: ForkConfig): void { +// Update default theme in siteConfig.ts +function updateThemeConfig(config: ForkConfig): void { if (!config.theme) return; - console.log("\nUpdating src/context/ThemeContext.tsx..."); + console.log("\nUpdating default theme in src/config/siteConfig.ts..."); - updateFile("src/context/ThemeContext.tsx", [ + updateFile("src/config/siteConfig.ts", [ { - search: /const DEFAULT_THEME: Theme = "(?:dark|light|tan|cloud)";/, - replace: `const DEFAULT_THEME: Theme = "${config.theme}";`, + search: /defaultTheme: "(?:dark|light|tan|cloud)"/, + replace: `defaultTheme: "${config.theme}"`, }, ]); } @@ -844,7 +844,7 @@ function main(): void { updateRobotsTxt(config); updateOpenApiYaml(config); updateAiPluginJson(config); - updateThemeContext(config); + updateThemeConfig(config); console.log("\n========================="); console.log("Configuration complete!"); diff --git a/src/components/SocialFooter.tsx b/src/components/SocialFooter.tsx index ef49ca9..d3f17ac 100644 --- a/src/components/SocialFooter.tsx +++ b/src/components/SocialFooter.tsx @@ -2,7 +2,7 @@ import siteConfig from "../config/siteConfig"; import type { SocialLink } from "../config/siteConfig"; import { GithubLogo, - TwitterLogo, + XLogo, LinkedinLogo, InstagramLogo, YoutubeLogo, @@ -16,7 +16,7 @@ import { // Exported for reuse in header social icons export const platformIcons: Record = { github: GithubLogo, - twitter: TwitterLogo, + twitter: XLogo, linkedin: LinkedinLogo, instagram: InstagramLogo, youtube: YoutubeLogo, diff --git a/src/config/siteConfig.ts b/src/config/siteConfig.ts index ae57a49..ba95b3c 100644 --- a/src/config/siteConfig.ts +++ b/src/config/siteConfig.ts @@ -80,6 +80,11 @@ export interface GitHubRepoConfig { // default font family options: "serif" (New York), "sans" (system fonts), "monospace" (IBM Plex Mono) export type FontFamily = "serif" | "sans" | "monospace"; +// Theme configuration +// Controls the default color theme for the site +// Options: "dark", "light", "tan", "cloud" +export type Theme = "dark" | "light" | "tan" | "cloud"; + // Right sidebar configuration // Shows CopyPageDropdown in a right sidebar on posts/pages at 1135px+ viewport width export interface RightSidebarConfig { @@ -274,6 +279,9 @@ export interface SiteConfig { // Font family configuration fontFamily: FontFamily; + // Default theme configuration + defaultTheme?: Theme; + // Featured section configuration featuredViewMode: "cards" | "list"; featuredTitle: string; // Featured section title (e.g., "Get started:", "Featured", "Popular") @@ -374,6 +382,10 @@ export const siteConfig: SiteConfig = { // Options: "serif" (New York), "sans" (system fonts), "monospace" (IBM Plex Mono) fontFamily: "sans", + // Default theme configuration + // Options: "dark", "light", "tan", "cloud" + defaultTheme: "tan", + // Featured section configuration // viewMode: 'list' shows bullet list, 'cards' shows card grid with excerpts featuredViewMode: "cards", diff --git a/src/context/ThemeContext.tsx b/src/context/ThemeContext.tsx index 4fcd350..424706d 100644 --- a/src/context/ThemeContext.tsx +++ b/src/context/ThemeContext.tsx @@ -1,10 +1,8 @@ import { createContext, useContext, useState, useEffect, ReactNode } from "react"; +import { siteConfig, Theme } from "../config/siteConfig"; -// Available theme options -type Theme = "dark" | "light" | "tan" | "cloud"; - -// Default theme for new users (tan matches warm aesthetic) -const DEFAULT_THEME: Theme = "tan"; +// Default theme for new users (reads from siteConfig, falls back to "tan") +const DEFAULT_THEME: Theme = siteConfig.defaultTheme || "tan"; interface ThemeContextType { theme: Theme; diff --git a/src/pages/Post.tsx b/src/pages/Post.tsx index 4939ef6..ef52f2a 100644 --- a/src/pages/Post.tsx +++ b/src/pages/Post.tsx @@ -13,7 +13,8 @@ import ContactForm from "../components/ContactForm"; import { extractHeadings } from "../utils/extractHeadings"; import { useSidebar } from "../context/SidebarContext"; import { format, parseISO } from "date-fns"; -import { ArrowLeft, Link as LinkIcon, Twitter, Rss, Tag } from "lucide-react"; +import { ArrowLeft, Link as LinkIcon, Rss, Tag } from "lucide-react"; +import { XLogo, LinkedinLogo } from "@phosphor-icons/react"; import { useState, useEffect } from "react"; import siteConfig from "../config/siteConfig"; @@ -452,6 +453,14 @@ export default function Post({ ); }; + const handleShareLinkedIn = () => { + const url = encodeURIComponent(window.location.href); + window.open( + `https://www.linkedin.com/sharing/share-offsite/?url=${url}`, + "_blank", + ); + }; + // Check if this post should use docs layout if (post.docsSection && siteConfig.docsSection?.enabled) { const docsHeadings = extractHeadings(post.content); @@ -639,10 +648,18 @@ export default function Post({ +