-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add development server documentation
- Loading branch information
1 parent
7902470
commit 4e2771c
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |