Add GitHub README component via content loader#158
Merged
just-be-dev merged 14 commits intomainfrom Jan 19, 2026
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
just-be-dev | 7a0b172 | Commit Preview URL Branch Preview URL |
Jan 19 2026, 05:35 PM |
Implement a content loader that fetches GitHub READMEs from projects and renders them using Astro's renderMarkdown(). Adds a ::readme MDC component for embedding project READMEs, and updates the CCPM project page to use it. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Avoid circular dependency by parsing project frontmatter directly from filesystem instead of importing astro:content within the loader.
Replace build-time README loader with live content collection that fetches from GitHub API at runtime. This enables always-fresh README content without requiring rebuilds. Changes: - Enable experimental liveContentCollections flag - Create github-readme-live-loader.ts using GitHub API - Add src/live.config.ts for live collections - Update Readme component to use getLiveEntry() - Set prerender=false on project detail pages for SSR - Remove old build-time loader - Add marked dependency for markdown parsing The loader defaults to just-be-dev org but accepts owner parameter to fetch READMEs from other GitHub users/orgs.
af88bc2 to
a449374
Compare
Changed collection name to singular form for consistency with other collections (blog, projects, research, talks, etc.). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove the first H1 from README content to avoid duplicate headings on project pages. The project page already displays the project title as H1, so the README H1 (typically the repo name) is redundant. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add custom marked renderer to apply Link component styling to all links in READMEs: - Bold, underlined styling with hover effects - External links open in new tab with rel="noopener noreferrer" - External links get arrow indicator (↗) This ensures README links match the site's link styling without requiring the Link component. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace the marked custom renderer approach with pure CSS styling in the Readme component. This is cleaner and more maintainable: - CSS handles all link styling (color, bold, underline, hover effects) - CSS ::after pseudo-element adds external link arrow indicator - Small client script sets target="_blank" on external links This separates concerns: the loader renders markdown, and the component handles presentation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Move the external link handling from client-side JavaScript to the marked renderer. External links now get target="_blank" and rel="noopener noreferrer" at render time instead of via DOM manipulation. This is more efficient and ensures the attributes are present in the initial HTML. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The scoped <style> block in Readme.astro wasn't working because content inserted with set:html bypasses Astro's style scoping. Moved link styles to src/styles/global.css where they properly apply to dynamically rendered README content. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement a content loader that fetches GitHub READMEs from projects with GitHub repositories and renders them using Astro's
renderMarkdown(). The new::readmeMDC component enables embedding project READMEs directly in project pages.The loader automatically discovers projects with GitHub repository URLs, fetches their README files at build time, and stores them in a new
readmescollection. This approach uses Astro's markdown pipeline for consistent syntax highlighting and plugin support.Changes
src/loaders/readme-loader.ts) that discovers and fetches GitHub READMEs::readmeMDC component (src/components/Readme.astro) for embedding READMEs