Gazetta is a static site generator written in rust. There are four parts:
I've only tested Gazetta on 64bit Linux but it should work on all *nix platforms. However, it probably won't work on windows (I assume forward slashes in paths). Patches welcome!
cargo build --release
). Build in
release mode unless you want to pay a 15x-30x performance penalty.gazetta new blog "Hello World"
will create a hello world blog
post.gazetta render /path/to/output
(in the root of the repository) to
render your website.That's your website data.
text
config.yaml
This is the website's core config. It can be used to specify shared variables available when rendering any page on the site. It must specify:
If you're using the default renderer (gazetta-bin), you must also specify
an author
(see the Person section) format:
And may specify a set of navigational links:
```yaml nav:
text
/
└── assets/
├── javascript/
│ ├── 0-example1.js
│ └── 1-example2.js
├── stylesheets/
│ ├── 0-example1.css
│ └── 1-example2.css
└── icon.png
All files are optional.
icon.png
: The website's icon.javascript
: The website's javascript files. They will be concatenated
in lexicographical on build.stylesheets
: The website's stylesheets. They will be concatenated in
lexicographical on build.All other files in assets
will be ignored.
An entry consists of:
index.txt
, index.html
, or index.md
).static
directory containing static files.All index files must have a yaml header. This header must include a title
and anything else required by your specify renderer. By default, the header may
also include:
YYYY-MM-DD
.If you're using the default renderer, the header may also include:
Directories and files inside the static directory will be copied as-is to the output directory. This is a good place to put per-page static media.
The index field can either be a boolean or a table with the following optional fields:
```yaml
sort: date
paginate: false
directories: .
max: false ```
When specifying people, you can either just write their name or use the following table:
yaml
name: My Name # Mandatory
email: email
photo: photo
key: pgp_key_url
nicknames:
- first nick
- second nick
also: # A list of profiles around the web.
- "GitHub": github_url # example
- "reddit": reddit_profile_url # example
I'm happy with the overall architecture but some of the code could use a little love (the main render function is especially atrocious). Again, patches welcome.
Gazetta is pretty damn fast; there's a reason I don't bother displaying progress. However, there is room for improvement:
Θ(num_indices*num_entries)
. This could be
reduced to Θ(num_entries)
however, num_indices
is usually rather low so
this only makes sense if we can keep the constant multiplier in the new
algorithm's runtime low.