Godocument

Phillip England_

Godocument

Documentation

To read the full documentation, check out godocument.dev

Introduction

What is Godocument?

Godocument is a static site generator inspired by Docusaurus and powered by Htmx. Documenting your code should be simple.

Godocument requires Go version 1.22.0 or greater

Hello, World

A Godocument website can be created using the following steps:

  • Make a directory
1mkdir <your-apps-name>
2cd <your-apps-name>
  • Clone the repo
1git clone https://github.com/phillip-england/godocument .
  • Reset the project
1go run main.go --reset
  • Add some new entries to godocument.config.json:
 1{
 2    "docs": {
 3        "Introduction": "/introduction.md",
 4        "First Page": "/first-page.md",
 5        "First Section": {
 6            "Second Page": "/first-section/second-page.md"
 7        }
 8    },
 9    "meta": {
10        "title": "My Website"
11    }
12}
  • Inside of /docs, create first-page.md
1touch /docs/first-page.md
  • Add the following lines to /docs/first-page.md
1<meta name="description" content="Explore my first page with Godocument"></meta>
2
3# First Page
4
5## Hello, World
6
7This is the first page I've created using Godocument!
  • Inside of /docs create a directory called /first-section
1mkdir /docs/first-section
  • Inside of /docs/first-section, create a file called second-page.md
1touch /docs/first-section/second-page.md
  • Add the following lines to /docs/first-section/second-page.md
1<meta name="description" content="Explore my second page with Godocument"></meta>
2
3# Second Page
4
5## Hello, World
6
7This is the second page I've created using Godocument!
  • From your application's root directory, run the following command to view the results on localhost:8080:
1go run main.go
  • To test your static assets locally, run:
1go run main.go --build
  • To build for production, run:
1go run main.go --build <your-server-url>

That's it! Your example is deployment-ready and can be found at /out. You can easily deploy on Github Pages, Amazon S3, or a CDN of your choice.