mirror of
https://github.com/waynesutton/markdown-site.git
synced 2026-01-12 04:09:14 +00:00
update: semantic search is now Optional configuration
This commit is contained in:
5
TASK.md
5
TASK.md
@@ -10,9 +10,12 @@ v2.10.1 ready. Semantic search now optional via siteConfig.semanticSearch.enable
|
||||
|
||||
- [x] Optional semantic search configuration
|
||||
- [x] Added `SemanticSearchConfig` interface to `siteConfig.ts`
|
||||
- [x] Added `semanticSearch.enabled` toggle (default: true)
|
||||
- [x] Added `semanticSearch.enabled` toggle (default: false to avoid blocking forks)
|
||||
- [x] Updated `SearchModal.tsx` to conditionally show mode toggle
|
||||
- [x] Updated `sync-posts.ts` to skip embedding generation when disabled
|
||||
- [x] Updated `src/pages/Dashboard.tsx` with semantic search config option
|
||||
- [x] Updated `FORK_CONFIG.md` with Semantic Search Configuration section
|
||||
- [x] Updated `fork-config.json.example` with semanticSearch option
|
||||
- [x] Updated `docs-semantic-search.md` with enable/disable section
|
||||
- [x] Updated `docs.md` with semantic search configuration note
|
||||
|
||||
|
||||
4
files.md
4
files.md
@@ -35,7 +35,7 @@ A brief description of each file in the codebase.
|
||||
|
||||
| File | Description |
|
||||
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `siteConfig.ts` | Centralized site configuration (name, logo, blog page, posts display with homepage post limit and read more link, featured section with configurable title via featuredTitle, GitHub contributions, nav order, inner page logo settings, hardcoded navigation items for React routes, GitHub repository config for AI service raw URLs, font family configuration, right sidebar configuration, footer configuration with markdown support, social footer configuration, homepage configuration, AI chat configuration, aiDashboard configuration with multi-model support for text chat and image generation, newsletter configuration with admin and notifications, contact form configuration, weekly digest configuration, stats page configuration with public/private toggle, dashboard configuration with optional WorkOS authentication via requireAuth, image lightbox configuration with enabled toggle, semantic search configuration with enabled toggle) |
|
||||
| `siteConfig.ts` | Centralized site configuration (name, logo, blog page, posts display with homepage post limit and read more link, featured section with configurable title via featuredTitle, GitHub contributions, nav order, inner page logo settings, hardcoded navigation items for React routes, GitHub repository config for AI service raw URLs, font family configuration, right sidebar configuration, footer configuration with markdown support, social footer configuration, homepage configuration, AI chat configuration, aiDashboard configuration with multi-model support for text chat and image generation, newsletter configuration with admin and notifications, contact form configuration, weekly digest configuration, stats page configuration with public/private toggle, dashboard configuration with optional WorkOS authentication via requireAuth, image lightbox configuration with enabled toggle, semantic search configuration with enabled toggle and disabled by default to avoid blocking forks without OPENAI_API_KEY) |
|
||||
|
||||
### Pages (`src/pages/`)
|
||||
|
||||
@@ -63,7 +63,7 @@ A brief description of each file in the codebase.
|
||||
| `BlogPost.tsx` | Markdown renderer with syntax highlighting, collapsible sections (details/summary), text wrapping for plain text code blocks, image lightbox support (click images to magnify in full-screen overlay), and iframe embed support with domain whitelisting (YouTube and Twitter/X only) |
|
||||
| `CopyPageDropdown.tsx` | Share dropdown with Copy page (markdown to clipboard), View as Markdown (opens raw .md file), Download as SKILL.md (Anthropic Agent Skills format), and Open in AI links (ChatGPT, Claude, Perplexity) using local /raw URLs with simplified prompt |
|
||||
| `Footer.tsx` | Footer component that renders markdown content from frontmatter footer field or siteConfig.defaultContent. Can be enabled/disabled globally and per-page via frontmatter showFooter field. Renders inside article at bottom for posts/pages, and in current position on homepage. Supports images with size control via HTML attributes (width, height, style, class) |
|
||||
| `SearchModal.tsx` | Full text search modal with keyboard navigation |
|
||||
| `SearchModal.tsx` | Full text search modal with keyboard navigation. Supports keyword and semantic search modes (toggle with Tab). Semantic mode conditionally shown when `siteConfig.semanticSearch.enabled: true`. When semantic disabled (default), shows keyword search only without mode toggle. |
|
||||
| `FeaturedCards.tsx` | Card grid for featured posts/pages with excerpts |
|
||||
| `LogoMarquee.tsx` | Scrolling logo gallery with clickable links |
|
||||
| `MobileMenu.tsx` | Slide-out drawer menu for mobile navigation with hamburger button, includes sidebar table of contents when page has sidebar layout |
|
||||
|
||||
@@ -7,6 +7,29 @@ Date: 2026-01-06
|
||||
|
||||
All notable changes to this project.
|
||||
|
||||
## v2.10.1
|
||||
|
||||
Released January 5, 2026
|
||||
|
||||
**Optional semantic search configuration**
|
||||
|
||||
Semantic search can now be disabled via `siteConfig.semanticSearch.enabled`:
|
||||
|
||||
```typescript
|
||||
semanticSearch: {
|
||||
enabled: false, // Disable semantic search, use keyword only
|
||||
},
|
||||
```
|
||||
|
||||
When disabled:
|
||||
- Search modal shows only keyword search (no mode toggle)
|
||||
- Embedding generation skipped during sync (saves API costs)
|
||||
- Existing embeddings preserved in database (no data loss)
|
||||
|
||||
Default is `enabled: false` (keyword search only, no API key required). Set to `true` and configure OPENAI_API_KEY to enable semantic search.
|
||||
|
||||
Updated files: `src/config/siteConfig.ts`, `src/components/SearchModal.tsx`, `scripts/sync-posts.ts`, `src/pages/Dashboard.tsx`, `FORK_CONFIG.md`, `fork-config.json.example`, `content/pages/docs-semantic-search.md`, `content/pages/docs.md`
|
||||
|
||||
## v2.10.0
|
||||
|
||||
Released January 5, 2026
|
||||
|
||||
@@ -79,6 +79,31 @@ If the key is not configured:
|
||||
- Keyword search continues to work normally
|
||||
- Sync script skips embedding generation
|
||||
|
||||
### Enable/Disable Semantic Search
|
||||
|
||||
Semantic search is **disabled by default** to avoid requiring API keys for forks. Enable it via `src/config/siteConfig.ts`:
|
||||
|
||||
```typescript
|
||||
semanticSearch: {
|
||||
enabled: true, // Enable semantic search (requires OPENAI_API_KEY)
|
||||
},
|
||||
```
|
||||
|
||||
When disabled (default):
|
||||
- Search modal shows only keyword search (no mode toggle)
|
||||
- Embedding generation skipped during sync (saves API costs)
|
||||
- No OpenAI API key required
|
||||
|
||||
When enabled:
|
||||
- Search modal shows both Keyword and Semantic modes
|
||||
- Embeddings generated during `npm run sync`
|
||||
- Requires OPENAI_API_KEY in Convex
|
||||
|
||||
To enable semantic search:
|
||||
1. Set `semanticSearch.enabled: true` in siteConfig.ts
|
||||
2. Set `OPENAI_API_KEY` in Convex: `npx convex env set OPENAI_API_KEY sk-xxx`
|
||||
3. Run `npm run sync` to generate embeddings
|
||||
|
||||
### How embeddings are generated
|
||||
|
||||
When you run `npm run sync`:
|
||||
|
||||
@@ -88,8 +88,11 @@ Press `Command+K` (Mac) or `Ctrl+K` (Windows/Linux) to open the search modal. Cl
|
||||
- Result snippets with context around matches
|
||||
- Distinguishes between posts and pages
|
||||
- Works with all four themes
|
||||
- Two search modes: [Keyword](/docs-search) (exact match) and [Semantic](/docs-semantic-search) (meaning-based)
|
||||
|
||||
Search uses Convex full text search indexes. No configuration needed.
|
||||
Search uses Convex full text search indexes. No configuration needed for keyword search.
|
||||
|
||||
**Semantic search configuration:** Requires `OPENAI_API_KEY` in Convex. Can be disabled via `siteConfig.semanticSearch.enabled: false`. See [Semantic Search](/docs-semantic-search) for details.
|
||||
|
||||
## Copy Page dropdown
|
||||
|
||||
|
||||
Reference in New Issue
Block a user