dinhanhthi/dinhanhthi.com
概要
🔥 My personal website for taking notes. It uses Next.js and Notion as CMS.
仕事効率化・自動化計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- 0
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルdinhanhthi.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/
関連プロジェクトを探す
読み込み中…