Hello World! π
This repository contains the source code for my blog (chris.lu)
On chris.lu, you will find my tutorials and can learn more about me
During development, I wrote a "Next.js static first starterkit" tutorial showcasing the technologies used in this blog. My favorite approach when working with Next.js is to start with a static core, later you can add dynamic islands where necessary.
I added MDX support to be able to create content using @next/mdx. The project uses a comprehensive MDX plugin pipeline:
- Remark plugins:
remark-gfm,remark-frontmatter,remark-mdx-frontmatter, remark-table-of-contents (custom) - Rehype plugins:
rehype-pretty-code, rehype-github-alerts (custom),rehype-slug,rehype-autolink-headings,rehype-mdx-import-media
Content is written as MDX files in the app/ directory with YAML frontmatter for metadata. The %toc% placeholder auto-generates a table of contents.
WebGL Header Animation: I had a lot of fun doing my WebGL header animation using react-three-fiber (a React renderer for three.js). The animation is dynamically imported and includes adaptive DPR for performance.
Music Player: I also added a jukebox like music player (on the top right) using my web-audio-api-player and added a dynamic waveform using my waveform-visualizer and waveform-data-generator packages
- Node.js >= 20.11.0
- npm (comes with Node.js)
-
Clone the repository:
git clone https://github.com/chrisweb/chris.lu.git cd chris.lu -
Install dependencies:
npm i
-
Start the development server:
npm run dev
-
Open http://localhost:3000 in your browser
- Port already in use: Set a custom port with
PORT=3001 npm run dev - Build errors: Try
npm run lint-fixto auto-fix linting issues - Node version mismatch: Check your Node version with
node -v(must be >= 20.11.0)
npm run dev- Standard development servernpm run dev-ssl- Development with self-signed SSL certificate (requires certificate setup)
The project uses ESLint 9 with flat config for code and MDX content:
npm run lint- Check code and MDX for issues (used in build)npm run lint-fix- Auto-fix linting problemsnpm run lint-nocache- Lint without cache (useful for debugging)npm run lint-debug- Verbose linting outputnpm run check-urls- Validate external URLs in content (run sporadically, not in build)
When to use which:
- During development:
npm run lint-fixto auto-correct issues - Before committing:
npm run lintto verify - Periodically:
npm run check-urlsto validate external links
- Blog posts/tutorials: Create
.mdxfiles inapp/web_development/posts/orapp/web_development/tutorials/ - Add frontmatter at the top of each MDX file:
--- title: "Your Post Title" description: "Brief description" date: "2025-01-15" ---
- Table of contents: Use
%toc%placeholder where you want the TOC to appear - Images: Place in
public/assets/images/and reference with/assets/images/your-image.jpg - OpenGraph images: Create
opengraph-image.tsxin the same directory as your page or use a global opengraph for a route segment as done in app\web_development\og[key]
If you have feedback or want to discuss something, please use the chris.lu github discussions, and if you find a bug, please report it using the github issues
Link to the license document