dinhanhthi/dinhanhthi.com
Ă€ propos
🔥 My personal website for taking notes. It uses Next.js and Notion as CMS.
Productivité et automatisationProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
Originaldinhanhthi.com
Next.js 15+ 🤝 Tailwind CSS v4 🤝 pnpm 🤝 Notion as CMS 🤝 Custom Notion Renderer 🤝 Pagefind Search 🤝 GitHub Pages + GitHub Actions.
🎉 You can read this post to understand the ideas behind and create your own a site like mine.
🎊 What's new in v7? Check this post.
🧡 If what I do is helpful to you for some reason, please consider supporting me. Thank you!
Previous versions
👉 Version 1 (Jekyll): v1.dinhanhthi.com -- source.
👉 Version 2 (Jekyll): v2.dinhanhthi.com -- source.
👉 Version 3 (Jekyll): v3.dinhanhthi.com -- source.
👉 Version 4 (Gatsby, canceled at 60%): demo of what I did -- source.
👉 Version 5 (11ty): v5.dinhanhthi.com -- source.
👉 Version 6 (use separated notion-x repo): source.
Architecture
- CMS: Notion — all content lives in Notion databases
- Build: All pages pre-rendered at build time via
generateStaticParams(full SSG) - Search: Pagefind — client-side search, indexes HTML at build time
- Deploy: GitHub Pages — static export (
output: 'export',out/) deployed via GitHub Actions - Schedule: GitHub Actions cron builds daily to pull latest Notion content
- OG Images: static
/og-image.jpgfor every page
Dev
You have to install globally Nodejs >=22 (recommend using nvm) and pnpm first. Then
# Copy and fill all variables (1st time only)
cp example.env.local .env.local
# install (1st time only)
pnpm install
# Turn off being collected data via Telemetry program
# https://nextjs.org/telemetry
pnpm next telemetry disable
# dev
pnpm run dev # port 3004
# build (includes Pagefind indexing via postbuild)
pnpm run build
# serve (need to build first)
pnpm start # port 3004
# reinstall all
pnpm run reinstall
# clean
pnpm run clean
# prettier
pnpm run prettier
# clear pnpm cache (helpful sometimes)
pnpm store prune
Deployment
How it works
- GitHub Actions (
.github/workflows/deploy-pages.yml) builds the site daily (cron) or on push tomain/dev - During build, Next.js calls Notion API to fetch all content and exports every page as static HTML to
out/ - Pagefind indexes the generated HTML to create a client-side search index
- On
main,out/is deployed to GitHub Pages - If build fails, GitHub sends email notification and the previous Pages deployment stays live
Setup GitHub Pages + GitHub Actions
- Add the
ENV_FILEsecret: the full production.env.localcontent (must containNEXT_PUBLIC_SITE_DOMAIN=https://dinhanhthi.com):gh secret set ENV_FILE < .env.production.local.ENV_MODE/NEXT_PUBLIC_ENV_MODEare set by the workflow. - Pages source: Settings > Pages > Source "GitHub Actions" (or
gh api -X POST repos/dinhanhthi/dinhanhthi.com/pages -f build_type=workflow) - Custom domain:
gh api -X PUT repos/dinhanhthi/dinhanhthi.com/pages -f cname=dinhanhthi.com(aCNAMEfile is ignored for Actions deploys), then DNS (Cloudflare, DNS only): apexArecords185.199.108.153,185.199.109.153,185.199.110.153,185.199.111.153andwwwCNAME→dinhanhthi.github.io. Then enforce HTTPS. - Push to main — GitHub Actions will build and deploy automatically
See docs/STATIC.md for details.
Branches
mainbranch → build + deploy to GitHub Pages (ENV_MODE=prod, only published posts)devbranch → build only, no deploy (ENV_MODE=dev); GitHub Pages has one site per repo
Manual deploy
Trigger a manual build from GitHub Actions > "Build and Deploy to GitHub Pages" > "Run workflow".
Local build test
# Set ENV_MODE in .env.local, then:
pnpm run build
# Check build output — you should see all pages being generated
# Pagefind index will be created in out/pagefind/
Explorer des projets similaires
Chargement…