← All articles

Why this portfolio runs on Prismic

How I use Prismic and Next.js to keep content out of the code, and how I publish posts straight from Markdown files.

· 2 min read

When I rebuilt this site, I wanted one thing above all: to stop editing code every time I wanted to add something. A portfolio that's a chore to update ends up out of date. So the content lives in Prismic, a headless CMS, and the site is built with Next.js.

Content as building blocks

Prismic models content as slices: reusable sections like a text block, an image, a quote or a grid of cards. Each slice is a React component in the codebase and a matching block in the editor. Building a page means stacking slices, not writing markup.

The nice part is that the models live in the repo. Slice Machine keeps the content types and slices as JSON next to the components, versioned in git, and pushes them to Prismic when they change.

Two kinds of posts

The site has two post types:

  • Projects: case studies at /work, with the year, my role, the tech used and links to the live site and code
  • Articles: write-ups like this one at /blog, also available as an RSS feed

Both share the same slices, so a case study can be as simple or as rich as it needs to be. Tags tie everything together: they power the filters on the listing pages and the related posts at the end of each one.

Publishing from Markdown

The editor is great, but I prefer writing in my code editor. So I wrote a small script that turns a Markdown file into a Prismic document through its Migration API:

npm run post -- posts/why-this-portfolio-runs-on-prismic.md

Front-matter fills the fields (title, tags, excerpt), headings and lists become a Text slice, standalone images become Image slices and are uploaded to the media library, and blockquotes become Quote slices. The post lands as a draft I can review in Prismic before it goes live. This article was published exactly that way.

Worth it?

For a site that changes in small, frequent bursts, yes. The code stays focused on presentation, the content stays editable from anywhere, and adding a post takes minutes instead of a deploy.

Want something like this built? Let's talk.

Get in touch