Writing
A home for ideas with MDX
Keep writing close to the code, with Markdown for the words and components when they help.
Markdown gives writing a simple structure. MDX adds the ability to place React components inside that structure when an example needs more than text.
Keep the writing readable
A post can begin with ordinary paragraphs, headings, lists, links, and code blocks. Most articles need nothing more. Keeping the source readable makes small edits easy to review.
Use components when they improve the explanation: an interactive example, a diagram, or a reusable callout. Avoid turning every paragraph into a custom component.
Give every post a stable address
A short, descriptive slug makes an article easy to share. Keep that address stable even if the title changes later.
Store the title, summary, publication date, and slug together so that the homepage, archive, and page metadata stay consistent. This portfolio keeps those entries in lib/blog.ts and the article bodies in content/blog/.
Publish a new post
- Add an
.mdxfile insidecontent/blog/. - Register its title, summary, date, slug, and import in
lib/blog.ts. - Check the article on a narrow screen and follow its links.
- Run the build before publishing.
The homepage shows the first four entries. The archive includes every registered post, and each entry gets its own reading page.
For the underlying setup, see the Next.js MDX guide.