Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Lightweight static site generator for documentation — Markdown to HTML, navigation, search, RSS, sitemap

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages