From ca40d199daee7e520dd65510e7a4ad3b25a9f934 Mon Sep 17 00:00:00 2001 From: Wayne Sutton Date: Sat, 3 Jan 2026 21:47:46 -0800 Subject: [PATCH] fix: AI service links now use local /raw URLs with simplified prompt - Changed ChatGPT, Claude, and Perplexity links from GitHub raw URLs to local /raw/{slug}.md - Simplified AI prompt from multi-line instructions to "Read this URL and summarize it:" - URLs now constructed using window.location.origin for consistency - Removed unused siteConfig import and getGitHubRawUrl function - No longer requires git push for AI links to work (synced content available immediately) Updated: src/components/CopyPageDropdown.tsx, changelog.md, task.md, files.md, changelog-page.md --- TASK.md | 8 ++++++- changelog.md | 12 ++++++++++ content/pages/changelog-page.md | 17 +++++++++++++ files.md | 2 +- src/components/CopyPageDropdown.tsx | 37 ++++++++++++----------------- 5 files changed, 52 insertions(+), 24 deletions(-) diff --git a/TASK.md b/TASK.md index af8c872..f961ee4 100644 --- a/TASK.md +++ b/TASK.md @@ -4,10 +4,16 @@ ## Current Status -v2.8.3 ready. Updated raw/index.md to include home.md and footer.md content. +v2.8.4 ready. AI service links now use local /raw URLs with simplified prompt. ## Completed +- [x] Update AI service links to use local /raw URLs + - [x] Changed ChatGPT, Claude, Perplexity links from GitHub raw URLs to `/raw/{slug}.md` + - [x] Simplified AI prompt to "Read this URL and summarize it:" + - [x] Removed unused `siteConfig` import and `getGitHubRawUrl` function + - [x] URLs now constructed using `window.location.origin` for consistency + - [x] Update raw/index.md to include home.md and footer.md content - [x] Updated `generateHomepageIndex` function in `scripts/sync-posts.ts` - [x] Home intro content (slug: home-intro) now displays at top of index.md diff --git a/changelog.md b/changelog.md index b52f333..8163a47 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,18 @@ 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.4] - 2026-01-03 + +### Changed + +- AI service links (ChatGPT, Claude, Perplexity) now use local `/raw/{slug}.md` URLs instead of GitHub raw URLs +- Simplified AI prompt from multi-line instructions to "Read this URL and summarize it:" + +### Technical + +- Updated `src/components/CopyPageDropdown.tsx` to construct URLs using `window.location.origin` +- Removed unused `siteConfig` import and `getGitHubRawUrl` function + ## [2.8.3] - 2026-01-03 ### Changed diff --git a/content/pages/changelog-page.md b/content/pages/changelog-page.md index 9470fe1..a18ba0a 100644 --- a/content/pages/changelog-page.md +++ b/content/pages/changelog-page.md @@ -12,6 +12,23 @@ docsSectionOrder: 4 All notable changes to this project. ![](https://img.shields.io/badge/License-MIT-yellow.svg) +## v2.8.4 + +Released January 3, 2026 + +**AI service links now use local /raw URLs** + +- ChatGPT, Claude, and Perplexity links now use local `/raw/{slug}.md` URLs instead of GitHub raw URLs +- Simplified AI prompt from multi-line instructions to "Read this URL and summarize it:" +- No longer requires git push for AI links to work (synced content available immediately) + +**Technical details:** + +- Updated URL construction to use `window.location.origin` for consistency +- Removed unused `siteConfig` import and `getGitHubRawUrl` function + +Updated files: `src/components/CopyPageDropdown.tsx` + ## v2.8.3 Released January 3, 2026 diff --git a/files.md b/files.md index 6ed6a68..093e937 100644 --- a/files.md +++ b/files.md @@ -61,7 +61,7 @@ A brief description of each file in the codebase. | `PostList.tsx` | Year-grouped blog post list or card grid (supports list/cards view modes, columns prop for 2/3 column grids, showExcerpts prop to control excerpt visibility) | | `BlogHeroCard.tsx` | Hero card component for the first blogFeatured post on blog page. Displays landscape image, tags, date, title, excerpt, author info, and read more link | | `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 GitHub raw URLs with universal prompt | +| `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 | | `FeaturedCards.tsx` | Card grid for featured posts/pages with excerpts | diff --git a/src/components/CopyPageDropdown.tsx b/src/components/CopyPageDropdown.tsx index a5342eb..b1dfb0c 100644 --- a/src/components/CopyPageDropdown.tsx +++ b/src/components/CopyPageDropdown.tsx @@ -7,27 +7,12 @@ import { Download, ExternalLink, } from "lucide-react"; -import siteConfig from "../config/siteConfig"; // Maximum URL length for query parameters (conservative limit) const MAX_URL_LENGTH = 6000; -// Universal AI prompt for reading raw markdown -const AI_READ_PROMPT = `Read the raw markdown document at the URL below. If the content loads successfully: -- Provide a concise accurate summary -- Be ready to answer follow up questions using only this document - -If the content cannot be loaded: -- Say so explicitly -- Do not guess or infer content - -URL:`; - -// Construct GitHub raw URL for a slug -function getGitHubRawUrl(slug: string): string { - const { owner, repo, branch, contentPath } = siteConfig.gitHubRepo; - return `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${contentPath}/${slug}.md`; -} +// Simple AI prompt for reading URLs +const AI_READ_PROMPT = "Read this URL and summarize it:"; // Extended props interface with optional metadata interface CopyPageDropdownProps { @@ -422,12 +407,14 @@ export default function CopyPageDropdown(props: CopyPageDropdownProps) { {/* Divider */} {/*
*/} - {/* AI service links using GitHub raw URLs */} - {/* Note: Requires git push to work - npm sync alone is not sufficient */} + {/* AI service links using local /raw URLs */}