static-site

command
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 5 Imported by: 0

README

GoFastr Static Site Example

A multi-page static website served from a folder of HTML files. Zero JavaScript framework — just HTML, CSS, and GoFastr's static file server.

Architecture

  • Pages: Regular HTML files in the pages/ directory — edit them like any static site
  • Serving: GoFastr's core/static module serves files with ETag caching and MIME detection
  • No build step: Drop HTML/CSS files in pages/, they're served as-is

File Structure

examples/static-site/
├── main.go              # Go server — mounts the pages/ folder
├── pages/
│   ├── index.html       # Landing page (/)
│   ├── about.html       # About page (/about.html)
│   ├── contact.html     # Contact page (/contact.html)
│   └── style.css        # Shared stylesheet
└── README.md

Running

cd examples/static-site
go run main.go
# Open http://localhost:3070

Adding Pages

Just create a new .html file in pages/ and link to it:

echo '<!DOCTYPE html><html>...' > pages/pricing.html
# → available at http://localhost:3070/pricing.html

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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