MonkeyProof is a personal blog built with Astro, focused on software architecture, backend engineering, and distributed systems, with a custom design and SEO/performance optimizations.
- Overview
- Tech Stack
- Project Structure
- Prerequisites
- Quick Start
- Local Setup
- Available Scripts
- Site Configuration
- Content and Frontmatter
- Main and OG Images
- Galleries
- Full-Text Search (Pagefind)
- GitHub Pages Deploy (Custom Domain)
- Troubleshooting
- License
Main features:
- Static blog with pagination, tags, archives, and RSS.
- Light/dark theme, client-side search, and custom UI.
- Dynamic Open Graph images for posts (with frontmatter/config fallbacks).
- Support for article main images (
mainImage) rendered as a dedicated card below the title. - Automated deploy to GitHub Pages with a custom domain.
- Framework:
astro(v6) - Content layer:
astro:content+zodschema - Styling: Tailwind CSS v4 + custom CSS
- Markdown/MDX:
@astrojs/mdx,remark-toc,remark-collapse - Search:
pagefind - SEO: sitemap + RSS + Open Graph
Main paths:
src/pages/: Astro routes (/,/posts,/tags,/rss.xml, etc.)src/layouts/: global layouts and post detail layoutsrc/components/: reusable UI componentssrc/data/blog/: Markdown/MDX postssrc/data/galleries/: gallery contentsrc/config.ts: main site configurationsrc/content.config.ts: collection frontmatter schema.github/workflows/deploy-pages.yml: GitHub Pages deploy pipeline
Required versions (aligned with Astro 6):
- Node.js
>= 22.12.0 - npm
>= 10
This repository includes:
package.jsonwithengines.nvmrcset to22.12.0
git clone https://github.com/davidemaggi/MonkeyProof.git
cd MonkeyProof
nvm use 22.12.0 || nvm install 22.12.0
npm ci
npm run devThen open the local URL shown in terminal (usually http://localhost:4321).
For a more explicit setup flow (useful on a fresh machine):
# from your local repository folder
nvm install 22.12.0
nvm use 22.12.0
npm ciRun in development:
npm run devBuild locally:
npm run buildPreview build:
npm run previewFrom package.json:
npm run dev: starts Astro dev servernpm run build:astro check+ build + Pagefind index + copy topublic/pagefindnpm run preview: serves the build outputnpm run sync: syncs Astro content/typesnpm run lint: lints the projectnpm run format: applies formattingnpm run format:check: checks formatting only
Note: build copies dist/pagefind into public/pagefind. During local work, this folder may appear as modified in your git working tree.
Main configuration is in src/config.ts (SITE):
- site data (
website,title,desc,author,profile) - avatar (
SITE.avatar.src,SITE.avatar.alt) - toggles (
lightAndDarkMode,showArchives,showGalleries,showBackButton) - base SEO settings (
ogImage,dynamicOgImage) - timezone and language
- intro audio options
Astro configuration in astro.config.ts:
site: SITE.website- MDX + sitemap integrations
- markdown plugins / Shiki transformers
- responsive image configuration
- public env schema (
PUBLIC_GOOGLE_SITE_VERIFICATION)
Blog collection in src/content.config.ts (blog):
Main fields:
title,description,pubDatetimetags,draft,featuredmainImage,mainImageAlt,mainImageCaption,mainImageCreditogImage(string fallback metadata)canonicalURL,timezone,hideEditPost
Example post: src/data/blog/HelloWorld.md.
OG priority logic used for post pages:
mainImageogImage- Dynamic OG (
/posts/<slug>/index.png) whenSITE.dynamicOgImageis enabled - Global fallback (
SITE.ogImage/og.png)
Important details:
mainImagecan be a local asset or a URL string.ogImageis a metadata string (valid example:/monkeyproof-og.png).- If
mainImageorogImageexists, dynamic OG is not generated for that post.
The project includes a gallery feature with dedicated routes (/galleries).
Full technical documentation:
GALLERIES.md
Feature flags in src/config.ts:
SITE.showGalleriesSITE.showGalleriesInIndex
Pagefind is generated at build time via:
pagefind --site dist
In local flow, the index is also copied into public/pagefind by the build script.
Automated deploy is configured in:
.github/workflows/deploy-pages.yml
Pipeline:
- Checkout
- Setup Node
22.12.0 npm ci- Build (
astro check,astro build --site "https://monkeyproof.dev" --base "/",pagefind) - Upload
distartifact - Deploy via
actions/deploy-pages
Custom domain:
public/CNAMEset tomonkeyproof.dev
One-time GitHub setting:
- Repository Settings -> Pages
- Source:
GitHub Actions
Symptom: warning/error for astro / @astrojs/* requiring Node >=22.12.0.
Fix:
nvm use 22.12.0
node -v
npm -v
npm ci- Ensure GitHub Pages source is
GitHub Actions. - Ensure workflow permissions include
pages: writeandid-token: write. - Ensure
monkeyproof.devDNS is correctly pointed to GitHub Pages.
- Use a root-relative path in frontmatter (
/monkeyproof-og.png). - Keep
ogImageas metadata string (already configured insrc/content.config.ts).
This project is distributed under the MIT license. See LICENSE.