Super simple static site generator.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

998 B

jlstatic

Simple static site generator.

Usage

  • Every page is in its own directory.
  • Relative links should point to other directories.
  • For every image, a thumbnail is created in a ./t/.
  • Files with the .md extension are turned into HTML.
  • All other files are copied.

Project Organization

./config.json   # Configuration file (see below). 
./template.html # One template used for every page. 
./src           # Root directory for source files.
./build         # Generated by program. 

Config File

The config file should be stored in the project's root directory in config.json.

type Config struct {
	RootName     string
	ThumbWidth   int
	ThumbHeight  int
	ThumbQuality int
}

Template Context

The context passed to the template contains the following:

type Context struct {
	Content     template.HTML
	Breadcrumbs []Breadcrumb
}

type Breadcrumb struct {
	FullPath string // Full path.
	Name     string // File basename.
}