Skip to content
insanaiPublic

About

A port of the Odin language website from Hugo to Guidedog, a documentation generator written in Odin: https://github.com/insanai/guidedog

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Odin website on Guidedog

This repository ports the complete Odin language website from Hugo to Guidedog, a documentation generator written in Odin. The original source is odin-lang/odin-lang.org. This checkout is the Guidedog project root. Its content, theme, media, native Odin plugin, and GitHub Pages workflow all live here. Package API documentation remains a separate site and repository.

Website: insanai.github.io/odindocs

Author with Guidedog

Install Guidedog 0.6.3 and Odin dev-2026-10, with both executables on PATH. Follow the Guidedog installation guide for the documentation generator's installation instructions. On Linux or macOS with Apple silicon, these helpers install the checksum-pinned releases in an ignored local directory:

odin_bin=$(tools/install-toolchain.sh odin "$PWD/.toolchain/odin")
tools/install-guidedog.sh "$PWD/.toolchain/guidedog"
export PATH="$odin_bin:$PWD/.toolchain/guidedog:$PATH"
odin version
guidedog --version

If the tools are already installed, skip those downloads. Run commands from the repository root. Compile and register the theme plugin once on this machine:

tools/setup.sh

Guidedog's native commands now work directly from this project root:

guidedog build dirhtml .                     # _build/dirhtml
guidedog build html .                        # _build/html
guidedog clean .                             # Remove generated output
ODINDOCS_BASE_URL=http://127.0.0.1:8000/ guidedog serve .

Open http://127.0.0.1:8000/ for the live preview. After an edit, refresh the browser: Guidedog checks its watched files and rebuilds before serving the request. Stop with Ctrl+C. To use another port, set both the URL and the server port:

ODINDOCS_BASE_URL=http://127.0.0.1:8080/ guidedog serve . --port 8080

The plugin supports both directory URLs for publishing and Guidedog's flat HTML URLs for live preview.

Guidedog's quickstart creates a new project. For individual pages, this native Odin plugin supplies a small scaffold through Guidedog's plugin CLI:

guidedog plugin run odin-site -- new docs/my-tutorial --title 'My tutorial' --summary 'What readers will learn.'
# A new section needs an index, just like other Guidedog projects:
guidedog plugin run odin-site -- new tutorials/index --title 'Tutorials'
guidedog plugin run odin-site -- new tutorials/hello --title 'Hello Odin'

You can also create Markdown or reStructuredText files directly. A heading and ordinary content are sufficient; custom front matter is not required:

# My tutorial

```{meta}
:description: What readers will learn.
:odin-weight: 14
```

## First steps

Read [Getting Started](/docs/install.md).

Your Markdown goes here.

The native {meta} directive is optional. Website fields use odin- names: odin-date, odin-lastmod, odin-weight, odin-linktitle, odin-redirect, odin-categories, and odin-tags. Lists use JSON, such as :odin-categories: ["tutorials"]. Native Guidedog toctrees, includes, labels, admonitions, code blocks, and document references work normally. Imported technical headings use explicit native labels to preserve cross-references and public anchors.

Section indexes contain native glob toctrees, so new immediate children are included automatically. Add nested sections to a toctree where appropriate. conf.toml controls source suffixes and exclusions; the plugin discovers new pages and sections from those settings. News is ordered newest first, while docs and community use weight, then title. Exclude drafts in conf.toml before building.

Maintainer recipes

The familiar Hugo tasks map to these Guidedog files and commands:

Hugo task Guidedog equivalent in this repository
hugo new / archetypes guidedog plugin run odin-site -- new …, or create a native document
content/ and _index.md Root content folders and index.md with native toctrees
YAML/TOML front matter A heading plus optional native {meta} fields
Shortcodes Native directives or ordinary HTML in the document
layouts/ _templates/odin/ and the native theme plugin
Site configuration conf.toml for Guidedog; odin-site.toml for website settings
static/ static/, copied by Guidedog's html_extra_path
hugo server ODINDOCS_BASE_URL=http://127.0.0.1:8000/ guidedog serve .
Publish the site tools/build.sh --pdf and the Pages workflow

A news article or tutorial: scaffold news/my-article or docs/my-tutorial, then edit the Markdown. For news, add a date and categories to its metadata:

# My article

```{meta}
:description: A short description for article listings.
:odin-date: 2026-10-14
:odin-categories: ["articles"]
:odin-tags: ["tutorial"]
```

## The first example

```odin
package main

import "core:fmt"

main :: proc() {
    fmt.println("Hello, Odin!")
}
```

News listings, taxonomy pages, and feeds update from this metadata. To keep a new draft out of the build, append its path to exclude_patterns in conf.toml. Remove that exclusion when ready. An included page with odin-draft: true causes a build error; exclude it first rather than relying on that field to hide it.

Links and sections: use source document links such as [Getting Started](/docs/install.md) so Guidedog chooses the correct HTML URL. Use native labels for stable cross-references: put (my-example)= immediately before a heading, then link with [Read the example](my-example). Add a new section's index.md to its parent's native {toctree} if a glob does not cover it. The root index discovers immediate section indexes; existing section indexes discover new immediate pages. Rename or delete pages by updating their source references and any explicit toctree entries, then run a strict build:

guidedog build dirhtml . -W

To keep an old published URL, retain its document with a title and :odin-redirect: /docs/new-location/ in its metadata.

Images and video: put assets in static/images/. From a document in docs/ or news/, a Markdown image can use ![Caption](../static/images/example.png). Ordinary HTML is supported for website media:

<video controls preload="metadata" poster="/images/example.png">
  <source src="/images/example.mp4" type="video/mp4">
</video>

For light/dark diagrams, use two images with the existing img-theme-light and img-theme-dark classes; news/better-package-documentation.md is a working example. Imported Hugo shortcodes have already been expanded; new content uses native Markdown, MyST directives, or HTML. Native admonitions use fences such as :::{note} followed by content and a closing :::.

Showcase and games: create a document in showcase/ or games/. Copy the metadata shape from showcase/spall.md or games/flappy_odin.md, giving it a title, description, outbound redirect, preview image/video, and platform information. odin-showcase-* and odin-game-* fields populate the original gallery cards. Use Steam or Itch.io for odin-game-platform to select the game gallery section.

Navigation and appearance: edit [[menu.main]] and [params] in odin-site.toml. Add a menu entry for a new top-level section if it should appear in the header. Sidebar labels use the heading or odin-linktitle; ordering uses odin-weight. Edit _templates/odin/ for layouts, static/css/guidedog-adapter.css for Guidedog-specific adjustments, or theme/scss/custom.scss for the original theme Sass. Refresh the local preview after changes. Recompile and register only when changing Odin plugin code.

Theme and build

_templates/odin/ holds the adapted Odin theme and all eleven homepage examples. odin-site.toml holds active navigation and slogans. Guidedog reads and renders the documents directly: the plugin has no source-rewriting hook. Its HTML and assets hooks handle the original theme, galleries, redirects, moved anchors, taxonomy pages, and feeds. Colours, typography, dark mode, syntax grammar, and browser interactions come from the original Odin website.

The plugin uses Odin's -vet -strict-style checks. Its SDK, TOML parser, and native Jinja engine are vendored under vendor/guidedog. Neither Hugo nor Python nor a sibling checkout is needed. Re-run tools/setup.sh after changing plugin code; Guidedog pins the registered executable's SHA-256. CI sets GUIDEDOG_CONFIG_DIR to an isolated .guidedog/ registry. The compiled plugin lives in .guidedog/bin/, so guidedog clean removes generated output while keeping the registered authoring and theme plugin available.

The official theme CSS is checked in. Node is needed only to change Sass:

npm ci
npm run build:css

ODINDOCS_BASE_URL selects another host or project path. Internal URLs are rebased without changing package API links or code examples. Production uses https://insanai.github.io/odindocs/.

Package for GitHub Pages

tools/build.sh          # HTML publication output in _build/html
tools/build.sh --pdf    # Add the three selected learning PDFs

Both commands invoke Guidedog's native builders. The publication script also copies namespaced plugin assets to the original RSS, sitemap, taxonomy, and 404 routes, and adds only allowlisted PDF downloads. Native authoring builds link to the plugin assets directly and do not require this packaging step. Packaging replaces _build/html so prior previews and removed pages cannot leak into a deployment.

[[pdf_documents]] in conf.toml is the PDF allowlist: language overview, demo examples, and the file-reading tutorial. Each is a standalone document. Never add index or a section index as a PDF root. --pdf adds download buttons to these pages; HTML-only builds expose no PDF buttons. The complete site is never a book.

To add a learning PDF, first create its standalone page in docs/ or news/, then add an entry such as this to conf.toml:

[[pdf_documents]]
root = "docs/my-tutorial"
file = "my-tutorial.pdf"
title = "My Tutorial"
author = "Odin contributors"

Run tools/build.sh --pdf and the checker. The download will be downloads/my-tutorial-en.pdf; only its matching page gets a PDF button. To remove an edition, remove its allowlist entry and rebuild. Keep a nonempty allowlist of standalone learning pages; the plugin rejects whole-site and section books.

.github/workflows/pages.yml tests native authoring, builds and audits pull requests and pushes to main, and deploys only main. GitHub Pages uses its artifact and OIDC workflow. Toolchain archives and Actions are pinned, and archives are verified against SHA-256 digests. Pages must use GitHub Actions as its source. Only _build/html is uploaded; downloads use Guidedog's -en filename suffix. After changing content, preview locally, run the checks, and push to main (or open a pull request first). Inspect the repository's Actions → Website run; a successful deployment updates the published Pages URL. Source files are the authoritative content; never edit generated _build/ HTML.

Verify

odin test plugins/odin-site/site -collection:guidedog=vendor/guidedog -vet -strict-style
tools/test-authoring.sh
odin run tools/check -collection:guidedog=vendor/guidedog -vet -strict-style -- --pdf

The authoring test creates temporary pages, builds them through Guidedog, checks references, includes, navigation and updates, then removes its test sources. The Odin checker audits all imported routes, local URLs and anchors, static assets, feeds, sitemap, and the PDF allowlist. Run it after publication packaging; omit --pdf for HTML-only output.

To inspect the exact Pages output, the native static preview remains available:

odin run tools/preview -vet -strict-style -- 8000 /odindocs

Open http://127.0.0.1:8000/odindocs/. This static preview requires a rebuild after edits; use guidedog serve for live authoring.

Provenance

migration.json records the imported upstream commit and all source mappings. Hugo front matter became headings and native metadata directives; image/video shortcodes became ordinary HTML, alerts became native admonitions, and section indexes became native toctrees. _index.md became index.md; slug filenames preserve public routes. Original Hugo layouts and configuration under theme/upstream/ are reference material and are not used to build.

All upstream assets remain under static/, with their original notices. The migration plugin, native tools, and adapted PDF template use Guidedog's GPL-3.0-or-later license in vendor/guidedog/LICENSE. The vendored libraries keep their license and notice. Toolchain installer files come from that pinned Guidedog revision.

About

A port of the Odin language website from Hugo to Guidedog, a documentation generator written in Odin: https://github.com/insanai/guidedog

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages