mirror of
https://git.mills.io/prologic/zs.git
synced 2024-11-17 17:56:11 -05:00
Update README
This commit is contained in:
parent
40d6f8312a
commit
a1308368b3
54
README.md
54
README.md
@ -12,9 +12,10 @@ Table of Contents:
|
|||||||
* [Features](#features)
|
* [Features](#features)
|
||||||
* [Installation](#installation)
|
* [Installation](#installation)
|
||||||
* [Ideology](#ideology)
|
* [Ideology](#ideology)
|
||||||
* [Extensions](#extensions)
|
* [Configuration](#configuration)
|
||||||
* [Extension: Include](#extension-include)
|
* [Configuration file](#configuration-file)
|
||||||
* [Extension: RSS](#extension-rss)
|
* [Include](#include)
|
||||||
|
* [RSS](#rss)
|
||||||
* [Hooks](#hooks)
|
* [Hooks](#hooks)
|
||||||
* [Command line usage](#command-line-usage)
|
* [Command line usage](#command-line-usage)
|
||||||
* [Frequently Asked Questions](#frequently-asked-questions)
|
* [Frequently Asked Questions](#frequently-asked-questions)
|
||||||
@ -51,12 +52,13 @@ For a starter template see the [zs-starter-tempate](https://git.mills.io/prologi
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
* Zero configuration (no configuration file needed)
|
- Zero configuration (optional configuration file)
|
||||||
* Cross-platform
|
- Highly configurable (flags, env vars, configuration file)
|
||||||
* Highly extensible
|
- Cross-platform (macOS, Windows, Linux)
|
||||||
* Works well for blogs and generic static websites (landing pages etc)
|
- Highly extensible via plugins in any language
|
||||||
* Easy to learn
|
- Works well for blogs and generic static websites (landing pages, etc)
|
||||||
* Fast
|
- Easy to learn
|
||||||
|
- Fast!
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@ -109,9 +111,24 @@ Every variable from the content header will be passed via environment variables
|
|||||||
- `$ZS_FILE` - a path to the currently processed markdown file
|
- `$ZS_FILE` - a path to the currently processed markdown file
|
||||||
- `$ZS_URL` - a URL for the currently generated page
|
- `$ZS_URL` - a URL for the currently generated page
|
||||||
|
|
||||||
## Extensions
|
## Configuration
|
||||||
|
|
||||||
Extensions are just executables in any language that output content. They can be system executables like `data` or custom extensions that you place in `.zs/`. To use an extensions simply reference it in your content like so:
|
By default no configuration is required. Variables can be defined at the top of each content page using YAML front-matter as described in [Idealogy](#ideology). As your site gets more complex, you _may_ want to define a site-level configuration file. There are a couple of ways to do this:
|
||||||
|
|
||||||
|
- Using command-line flags of `zs` itself, see `zs --help` for configuration options.
|
||||||
|
- Using environment variables such as `ZS_PRODUCTION=1`. These match the command-line flags above, are uppercase and prefixed with `ZS_`.
|
||||||
|
- Using `zs -c/--config ...` to pass an explicit configuration file.
|
||||||
|
- Placing a `.zs/config.yml` configuration file in your `.zs` directory.
|
||||||
|
|
||||||
|
### Configuration file
|
||||||
|
|
||||||
|
The basic structure of a configuration file looks like:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
|
||||||
|
## Plugins
|
||||||
|
|
||||||
|
Plugins are just executables in any language that output content. They can be system executables like `data` or custom scripts or programs that you place in `.zs/`. To use a plugins simply reference it in your content like so:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
Site last updated at {{{ date }}
|
Site last updated at {{{ date }}
|
||||||
@ -127,10 +144,11 @@ Here's a list of support features:
|
|||||||
|
|
||||||
Where `features` is a script defined in `.zs/features`
|
Where `features` is a script defined in `.zs/features`
|
||||||
|
|
||||||
Extensions can be written in any language you know (Bash, Python, Lua, JavaScript, Go, even Assembler).
|
Plugins can be written in any language you know (Bash, Python, Lua, JavaScript, Go, even Assembler).
|
||||||
Here are some example extensions you might find useful in your site.
|
|
||||||
|
|
||||||
### Extension: Include
|
Here are some example plugins you might find useful in your site.
|
||||||
|
|
||||||
|
### Include
|
||||||
|
|
||||||
`.zs/include`:
|
`.zs/include`:
|
||||||
|
|
||||||
@ -149,7 +167,7 @@ else
|
|||||||
fi
|
fi
|
||||||
```
|
```
|
||||||
|
|
||||||
### Extension: RSS
|
### RSS
|
||||||
|
|
||||||
`.zs/rss`:
|
`.zs/rss`:
|
||||||
|
|
||||||
@ -216,11 +234,11 @@ $ zs --help
|
|||||||
zs is an extremely minimal static site generator written in Go.
|
zs is an extremely minimal static site generator written in Go.
|
||||||
|
|
||||||
- Keep your texts in markdown, or HTML format right in the main directory of your blog/site.
|
- Keep your texts in markdown, or HTML format right in the main directory of your blog/site.
|
||||||
- Keep all service files (extensions, layout pages, deployment scripts etc) in the .zs subdirectory.
|
- Keep all service files (plugins, layout pages, deployment scripts etc) in the .zs subdirectory.
|
||||||
- Define variables in the header of the content files using YAML front matter:
|
- Define variables in the header of the content files using YAML front matter:
|
||||||
- Use placeholders for variables and plugins in your markdown or html files, e.g. {{ title }} or {{ command arg1 arg2 }}.
|
- Use placeholders for variables and plugins in your markdown or html files, e.g. {{ title }} or {{ command arg1 arg2 }}.
|
||||||
- Write extensions in any language you like and put them into the .zs sub-directory.
|
- Write plugins in any language you like and put them into the .zs sub-directory.
|
||||||
- Everything the extensions prints to stdout becomes the value of the placeholder.
|
- Everything the plugin prints to stdout becomes the value of the placeholder.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
zs [command]
|
zs [command]
|
||||||
|
Loading…
Reference in New Issue
Block a user