Serving org files with nextjs

In a bit of a whim, I decided to serve up org-files with nextjs. This would let me build my notes (like the one you're reading right now) directly to the site.

Process

  1. Add a new webpack rule for org files
  2. Parse org files to markdown with orgajs (this is a bit convuluted at the moment. It's org -> ast -> rehype -> remark), write a webpack loader for this
  3. Pass the result of that loader to mdx-js/loader.
  4. Write a plugin for mdx-js/loader that fixes links (i.e strips file endings, and removes file:// prefix if coming from og.
built with nextjs, mdx, and typescript view source