website-v2

I did it again

I rewrote my website again. It looks the same as it did before. Looking at it that way makes me ask "why did you even do that?" Ultimately, the reason comes down to wanting to learn new things, and be able to evaluate which frameworks suit which jobs.

Getting started with Next.js

This was much easier and cleaner than I had hoped.

# In an empty folder
npm init
npm i -S next react react-dom

Add the following to the package.json

{
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start",
    "export": "next build && next export"
  }
}

Create a pages directory.

And that's it. Add pages to pages and they appear.

What I added

The first thing was enabling Typescript by adding a tsconfig.json file. I really like Typescript, and that love has grown since VSCode came out. I've even started including type declarations in normat Javascript projects at work just to have types and autocompletion. Next.js has this built in, which makes things a lot easier. The only issue I've come across is that the _app.js and _document.js pages don't like being .tsx. To solve tht I just have the .js ones export a Typescript version that acutally had the component.

The next thing was MDX support. I've included more detail in my post about rebuilding this website with Next.js. There were a couple of interesting challenges that came up that I know know how to handle if they ever come up again.

Creating a static website with Next.js

/posts/static-site-with-next-js

Those are the main things, otherwise it's a pretty standard Next.js project. I didn't need anything fancy, as it's mostly just a simple blog.

Old website

In case you're interested, the previous version of the site is still up on GitHub. I've also kept the old posts where I taked about how it fits together.

This Website

/posts/this-website

website

/projects/website