siteforge

module
v0.0.0-...-0f28876 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: MIT

README

SiteForge

A lightweight static site generator for documentation, built in Go.

Features

  • Fast builds — Compile Markdown to HTML in milliseconds
  • Simple configuration — YAML-based site configuration
  • Themeable — Customizable HTML layouts with Go templates
  • Navigation — Automatic sidebar navigation from page weights
  • Search — Full-text search index generation
  • RSS — Automatic RSS feed generation
  • Sitemap — XML sitemap generation
  • Dev server — Live reload development server

Quick Start

# Install
go install github.com/EdgarOrtegaRamirez/siteforge/cmd/siteforge@latest

# Initialize a new site
siteforge init

# Build the site
siteforge build

# Serve locally
siteforge serve

Configuration

Create a siteforge.yaml file:

title: My Documentation
description: Project documentation
base_url: https://example.com/
theme: default
language: en
build:
  out_dir: public
  content_dir: content
  theme_dir: themes
  static_dir: static

Content

Create Markdown files in the content/ directory with optional front matter:

---
title: Page Title
weight: 1
---

# Page Title

Your content here.

Project Structure

siteforge/
├── content/           # Markdown content files
├── static/            # Static assets (CSS, JS, images)
├── themes/            # HTML themes
│   └── default/
│       └── layouts/   # HTML templates
├── siteforge.yaml     # Site configuration
└── public/            # Generated output

CLI Commands

Command Description
siteforge init Initialize a new site
siteforge build Build the static site
siteforge serve Start development server
siteforge version Print version

Architecture

cmd/siteforge/        CLI entry point (Cobra)
internal/
├── build/            Build pipeline orchestrator
├── config/           YAML configuration parser
├── feed/             RSS feed generator
├── markdown/         Goldmark-based Markdown renderer
├── nav/              Navigation sidebar builder
├── search/           Full-text search index builder
├── serve/            Development file server
├── sitemap/          XML sitemap generator
└── template/         Go template engine

Algorithms

  • Markdown parsing — Goldmark (CommonMark-compliant)
  • Navigation sorting — Weight-based with title fallback
  • Search indexing — TF-IDF-style scoring (title matches weighted 10x)
  • Front matter parsing — Simple key:value extraction
  • Slug generation — Lowercase, hyphenated, alphanumeric only

License

MIT

Directories

Path Synopsis
cmd
siteforge command
internal
build
Package build handles the site build pipeline.
Package build handles the site build pipeline.
config
Package config handles site configuration parsing and validation.
Package config handles site configuration parsing and validation.
feed
Package feed handles RSS feed generation.
Package feed handles RSS feed generation.
markdown
Package markdown handles Markdown to HTML rendering.
Package markdown handles Markdown to HTML rendering.
nav
Package nav handles navigation sidebar generation.
Package nav handles navigation sidebar generation.
search
Package search handles full-text search index generation.
Package search handles full-text search index generation.
serve
Package serve handles the development server.
Package serve handles the development server.
sitemap
Package sitemap handles sitemap.xml generation.
Package sitemap handles sitemap.xml generation.
template
Package template handles HTML template rendering.
Package template handles HTML template rendering.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL