Skip to content

Commit

Permalink
Add development server documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkKremer committed Aug 27, 2024
1 parent 7902470 commit 4e2771c
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions docs/01. Getting Started/02. Development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Development

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

## Clone the repository

```shell
git clone [email protected]:gopxl/docs.git
```

## Install 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`.
```shell
npm run build
```

Now you're ready to create the static site:
```shell
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.

```shell
npm run watch
```

Now start the development server:
```shell
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
```

0 comments on commit 4e2771c

Please sign in to comment.