source: code/trunk/README.md@ 36

Last change on this file since 36 was 13, checked in by zaitsev.serge, 10 years ago

added travis button

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