source: code/trunk/README.md@ 9

Last change on this file since 9 was 9, checked in by zaitsev.serge, 11 years ago

added readme

File size: 2.0 KB
Line 
1zs
2==
3
4zs is an extremely minimal static site generator written in Go.
5
6It's inspired by `zas` generator, but is even more minimal.
7
8The name stands for 'zen static' as well as it's my initials.
9
10## Features
11
12* Zero configuration (no configuration file needed)
13* Cross-platform
14* Highly extensible
15* Easy to learn
16* Fast
17
18## Installation
19
20Download the binaries from Github or build it manually:
21
22 $ go get github.com/zserge/zs
23
24## Ideology
25
26Keep your texts in markdown format in the root directory of your blog/site.
27
28Keep all service files (extensions, layout pages, deployment scripts etc)
29in the `.zs` subdirectory.
30
31Define variables in the header of the markdown files:
32
33 title: My web site
34 keywords: best website, hello, world
35
36 Markdown text goes after a *newline*
37
38Use placeholders for variables and plugins in your markdown or html
39files, e.g. `{{ title }}`.
40
41Write extensions in any language you like and put them into the `.zs`
42subdiretory.
43
44Everything the extensions prints to stdout becomes the value of the
45placeholder.
46
47Extensions can use special environment variables, like:
48
49* `$ZS` - a path to the `zs` executable
50* `$ZS_OUTDIR` - a path to the directory with generated files
51* `$ZS_FILE` - a path to the currently processed markdown file
52* `$ZS_URL` - a URL for the currently generated page
53
54You can also pass command line arguments, e.g: `{{ my-plugin arg1 arg2 }}`
55
56## Example of RSS generation
57
58## Hooks
59
60There are two special plugin names that are executed every time the build
61happens - `pre` and `post`. You can define some global action here like compile
62your LESS to CSS etc:
63
64 # .zs/post
65
66 #!/bin/sh
67 lessc < $ZS_OUTDIR/styles.less > $ZS_OUTDIR/styles.css
68 rm -f $ZS_OUTDIR/styles.css
69
70## Command line usage
71
72`zs build` re-builds your site.
73
74`zs watch` rebuilds your site every time you modify any file.
75
76`zs var <filename> [var1 var2...]` prints a list of variables defined in the
77header of a given markdown file, or the values of certain variables (even if
78it's an empty string).
79
80## License
81
82The software is distributed under the MIT license.
Note: See TracBrowser for help on using the repository browser.