all repos — vite @ 6855b44d8edaf25b35bde2461a106b3705b061c1

a fast (this time, actually) and minimal static site generator

readme (view raw)

 1go-vite
 2-------
 3
 4A fast (this time, actually) and minimal static site generator.
 5
 6NOTE: At this point, a lot of this code is heavily tailored towards my
 7own site.
 8
 9
10INSTALLING
11
12Clone this repository and run
13
14    $ make
15    # make install
16
17Requires `go` to be installed, obviously.
18
19
20USAGE
21
22    vite [options]
23
24    A simple and minimal static site generator.
25
26    options:
27        init PATH       create vite project at PATH
28        build           builds the current project
29        new PATH        create a new markdown post
30
31
32CONFIGURATION
33
34vite expects a config.yaml file to exist in the project root.  You can
35refer https://git.icyphox.sh/site/tree/config.yaml for an example
36containing all possible keys.
37
38
39TEMPLATING
40
41vite uses Go templating[2], and exposes two structure instances for
42rendering stuff in your template: `Cfg` and `Fm`, defined like so:
43
44    // Cfg
45    struct {
46    	Title        string            `yaml:"title"`
47    	Header       string            `yaml:"header"`
48    	DateFmt      string            `yaml:"datefmt"`
49    	SiteURL      string            `yaml:"siteurl"`
50    	Description  string            `yaml:"description"`
51    	Author       map[string]string `yaml:"author"`
52    	Footer       string            `yaml:"footer"`
53    	Prebuild     []string          `yaml:"prebuild"`
54    	Postbuild    []string          `yaml:"postbuild"`
55    	RSSPrefixURL string            `yaml:"rssprefixurl"`
56    }
57
58    // Fm
59    struct {
60        Template string
61        URL      string
62        Title    string
63        Subtitle string
64        Date     string
65        Body     string
66    }
67
68For an example, refer https://git.icyphox.sh/site/tree/templates
69
70
71FEEDS
72
73vite generates Atom feeds for all documents under the `pages/blog/`
74directory.  I plan to add generation for arbitrary directories, with
75ability to configure the feed file name (defaults to feed.xml right
76now). 
77
78[1]: https://github.com/icyphox/site
79[2]: https://golang.org/pkg/html/template/