gopxl logo

Development

This page explains how to set-up a development environment.

Cloning the repository

git clone git@github.com:gopxl/docs.git

Installing tools

To run this project, you'll need to install Go and NPM.

Compiling a static site

All CSS is compiled using Tailwind. Run the command below to bundle all the files. This will create a file public/css/docs.css.

npm run build

Now you're ready to create the static site:

go run . -docs 'docs' -repository path/to/project -url https://owner.github.io/project -repository-url https://github.com/owner/project -dest generated

This will create a static site in the generated directory.

Development server

When developing, it's easier to run the development server. First, start the Tailwind compiler so changes to layout and CSS files are automatically compiled. This command can be left running in the background.

npm run watch

Now start the development server:

go run . -docs 'docs' -repository path/to/project -repository-url https://github.com/owner/project

The last line of the output should show the url the site is reachable on:

2024/08/27 16:41:36 listening on http://localhost:8080

Edit this page on Github