mirror of
https://github.com/waynesutton/markdown-site.git
synced 2026-01-11 20:08:57 +00:00
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
This commit is contained in:
8
TASK.md
8
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
|
||||
|
||||
12
changelog.md
12
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
|
||||
|
||||
@@ -12,6 +12,23 @@ docsSectionOrder: 4
|
||||
All notable changes to this project.
|
||||

|
||||
|
||||
## 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
|
||||
|
||||
2
files.md
2
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 |
|
||||
|
||||
@@ -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 */}
|
||||
{/* <div className="copy-page-divider" role="separator" /> */}
|
||||
|
||||
{/* 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 */}
|
||||
<button
|
||||
className="copy-page-item"
|
||||
onClick={() => {
|
||||
const rawUrl = getGitHubRawUrl(props.slug);
|
||||
const rawUrl = new URL(
|
||||
`/raw/${props.slug}.md`,
|
||||
window.location.origin,
|
||||
).toString();
|
||||
const prompt = encodeURIComponent(`${AI_READ_PROMPT} ${rawUrl}`);
|
||||
window.open(
|
||||
`https://chatgpt.com/?q=${prompt}`,
|
||||
@@ -460,7 +447,10 @@ export default function CopyPageDropdown(props: CopyPageDropdownProps) {
|
||||
<button
|
||||
className="copy-page-item"
|
||||
onClick={() => {
|
||||
const rawUrl = getGitHubRawUrl(props.slug);
|
||||
const rawUrl = new URL(
|
||||
`/raw/${props.slug}.md`,
|
||||
window.location.origin,
|
||||
).toString();
|
||||
const prompt = encodeURIComponent(`${AI_READ_PROMPT} ${rawUrl}`);
|
||||
window.open(
|
||||
`https://claude.ai/new?q=${prompt}`,
|
||||
@@ -493,7 +483,10 @@ export default function CopyPageDropdown(props: CopyPageDropdownProps) {
|
||||
<button
|
||||
className="copy-page-item"
|
||||
onClick={() => {
|
||||
const rawUrl = getGitHubRawUrl(props.slug);
|
||||
const rawUrl = new URL(
|
||||
`/raw/${props.slug}.md`,
|
||||
window.location.origin,
|
||||
).toString();
|
||||
const prompt = encodeURIComponent(`${AI_READ_PROMPT} ${rawUrl}`);
|
||||
window.open(
|
||||
`https://www.perplexity.ai/?q=${prompt}`,
|
||||
|
||||
Reference in New Issue
Block a user