Skip to content

metafacture/metafacture-blog

Repository files navigation

Metafacture Blog

This project is the source for the metafacture blog.

This project was created with the gatsby template gatsby-starter-blog.

Installation

Gatsby is build with Node.js.

Install Node.js

Windows

Download and install the latest Node.js version from the official Node.js website.

Unix

Install the lastest nvm version.

Set default Node.js version. When nvm is installed, it does not default to a particular node version. You’ll need to install the version you want and give nvm instructions to use it. See here to automatically switch to the correct node version (not necessary, but handy).

nvm install 18
nvm use 18

Install gatsby

npm install -g gatsby-cli

Start developing

The site runs with:

cd metafacture-blog
npm install # if you experience strange ERESOLVE dependecy errors, try "npm install --legacy-peer-deps gatsby"
gatsby develop

The site is now running at http://localhost:8000!

You can also use Docker compose:

$ docker compose up

to spin up a docker container as configured in Dockerfile.dev. Inside the container, the web server is running in development mode. The build is accessible on the host via port mapping at http://localhost:8000/.

Your project folder will be mounted into the container, with exceptions defined in .dockerignore. Fast refresh aka hot reloading is kept so changes to the source files should affect the generated static sites instantly.

If you added packages with npm i <package_name> make sure to rebuild the container with docker compose up --build --force-recreate.

Be sure to have either Docker Desktop or Docker Engine and Docker Compose installed.

Depending on your Docker setup you may have to use sudo with your Docker commands. Please see the post-installation steps for further information.

Be aware of the differences between docker compose (Compose V2) and docker-compose (Compose V1), the first is expected to be a drop-in replacement for the latter.

Build

To create a production build and output the built static files into the public directory, run:

cd metafacture-blog
gatsby build

If you want to view the production build locally, run:

gatsby serve

Once this starts, you can view your site at http://localhost:9000.