sitegen

command module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: MIT Imports: 30 Imported by: 0

README

sitegen

Sitegen is a simple but flexible static site generator.

Setup

Download the sitegen bundles from release page.

Bundled with the executables is a sample website that you can start with. Extract the zip file then run the command below.

# Run sitegen with development server
sitegen -serve
# Run final build
sitegen
# Build for github pages, just add -serve to test & add  -minify to minify output
sitegen -public ./docs
# Build in dist but serve under a subdirectory blog
sitegen -public ./dist  -base /blog
# For more options
sitegen -help

Built with sitegen

File Handlers

File handlers is a way to process any file differently when it changes by running a specific command.

If you want to run npm run build:css when it's development and npm run build:prod:css for final build add this to the css file:

/*
---
serve: npm run build:css
build: npm run build:prod:css
---
*/

Template functions

Uses go html template.

  • path - prefixes any path with base path
  • sources "(Path|Local|Filename|Meta.*)" "Pattern" - returns source array that matches pattern
  • data "file.json" - loads any data under data dir
  • json - converts data to json for javascript/json use
  • js - no escape js
  • html - no escape html
  • css - no escape
  • sort "(Path|Local|Filename|Meta.*)" "(asc|desc) - orders sources
  • limit n - limits sources
  • offset n - offsets sources

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