This post guides you on recreating the /releases
and /prs
pages in the Astro AntfuStyle Theme to showcase your GitHub releases and pull requests.
Configure the Loaders#
The /releases
and /prs
pages use astro-loader-github-releases and astro-loader-github-prs to fetch data for releases
and prs
content collections. In src/content/config.ts
, configure these loaders to fetch your GitHub activity data as described in their README:
Utilizing Astro Loaders for GitHub Data Integration
githubReleasesLoader
and githubPrsLoader
are Astro loaders built with the Content Loader API, enabling data fetching from various sources as content collections. This API, introduced in Astro 4.14, became stable in Astro 5.
Update Page Content#
Depending on your loader configuration, you can modify the settings in src/config.ts
that affect the UI of these two pages. Refer to the ==UI.githubView
configuration for specific details.
In src/pages/releases.mdx
and src/pages/prs.mdx
, you can update the frontmatter and directly modify the titles and subtitles rendered on the pages.
In src/components/views/GithubView.astro
, you can remove or update the footer text displayed on both pages.
Automate Data Refreshing#
Astro loaders fetch data only during builds. To refresh /releases
and /prs
after deployment, schedule a rebuild using your hosting platform.
This theme is hosted on GitHub, with the Live Demo deployed on Vercel. The rebuild is triggered via a GitHub workflow that periodically calls Vercel’s deploy hook.
If your setup is similar, start by creating a Vercel deploy hook (For Netlify, create a build hook), then store it as a secret in your GitHub repository, naming it VERCEL_DEPLOY_HOOK
. Finally, update the GitHub workflow file .github/workflows/scheduled-vercel-deploy.yml
to periodically call the deploy hook:
Additionally, to remove a page, uninstall the loader, delete its collection from src/content/config.ts
, and remove the .mdx
file in /page
.
Wrapping Up#
The theme uses SSG (Static Site Generation), so /releases
and /prs
updates rely on periodic rebuilds, which may cause slight delays (acceptable for GitHub data). For real-time updates, keep the current UI but switch to SSR (Server-side Rendering). Check the official docs for details.
Looking forward, the theme will continue leveraging Astro loaders to enable showcasing diverse external personal data. 🧩