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
mkdir <your-apps-name>
cd <your-apps-name>
  • Clone the repo
git clone https://github.com/phillip-england/godocument .
  • Reset the project
go run main.go --reset
  • Add some new entries to godocument.config.json:
{
    "docs": {
        "Introduction": "/introduction.md",
        "First Page": "/first-page.md",
        "First Section": {
            "Second Page": "/first-section/second-page.md"
        }
    },
    "meta": {
        "title": "My Website"
    }
}
  • Inside of /docs, create first-page.md
touch /docs/first-page.md
  • Add the following lines to /docs/first-page.md
<meta name="description" content="Explore my first page with Godocument"></meta>

# First Page

## Hello, World

This is the first page I've created using Godocument!
  • Inside of /docs create a directory called /first-section
mkdir /docs/first-section
  • Inside of /docs/first-section, create a file called second-page.md
touch /docs/first-section/second-page.md
  • Add the following lines to /docs/first-section/second-page.md
<meta name="description" content="Explore my second page with Godocument"></meta>

# Second Page

## Hello, World

This 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:
go run main.go
  • To test your static assets locally, run:
go run main.go --build

-- To build for production, run:

go 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.