Zine - a simple and opinionated tool to build your own magazine.
cargo install zine
Run zine new your-zine-site
, you'll get following directory:
``` $ tree your-zine-site your-zine-site ├── content # The content directory your seasons located │ └── season-1 # The first season directory │ ├── 1-first.md # The first markdown article in this season │ └── zine.toml # The season Zine config file └── zine.toml # The root Zine config file of this project
2 directories, 3 files ```
Run zine serve
to preview your zine site on your local computer:
``` $ cd your-zine-site
$ zine serve
███████╗██╗███╗ ██╗███████╗
╚══███╔╝██║████╗ ██║██╔════╝
███╔╝ ██║██╔██╗ ██║█████╗
███╔╝ ██║██║╚██╗██║██╔══╝
███████╗██║██║ ╚████║███████╗
╚══════╝╚═╝╚═╝ ╚═══╝╚══════╝
listening on http://127.0.0.1:3000 ```
Run zine build
to build your zine site into a static website:
``` $ cd your-zine-site
$ zine build
Build success! The build directory is build
.
```
A Zine project mainly consists of two kind zine.toml
files and a bunch of markdown files.
zine.toml
This root zine.toml
file describes your site meta and all your season's info.
```toml [site] url = "https://your-domain.com" name = "Your Zine Site Name" description = "" logo = "path/to/favicon"
menu = [ { name = "About", url = "/about" }, { name = "Blog", url = "/blog" }, ]
[theme]
primary-color = "#abcdef" secondary-color = "#fff"
main-color = "#000"
link-color = "#e07312"
background-image = "/static/background.png"
footer-template = "templates/footer.html"
[[season]]
slug = "s1"
number = 1
title = "Season 1"
path = "content/season-1"
intro = "content/season-1/intro.md"
[[season]] slug = "s2" number = 2 title = "Season 2" path = "content/season-2" ```
zine.toml
The season zine.toml
file list all your articles of this season.
```toml [[article]]
slug = "1"
file = "1-first.md"
title = "First article"
author = ""
cover = ""
pub_date = "2022-03-20"
publish = true
featured = true
[[article]]
```
Every markdown file located in pages
will be rendered as a Page. Just intuitive like this:
```
$ tree pages
pages
├── about.md # will be rendered as https://your-domain.com/about
├── blog
│ └── first.md # will be rendered as https://your-domain.com/blog/first
├── blog.md # will be rendered as https://your-domain.com/blog
└── faq.md # will be rendered as https://your-domain.com/faq
1 directory, 4 files ```
You can add an arbitrary number of comments for an article. Simply put the end matter below the article content.
end matter is a terminology similar to front matter in other Static Site Generators. Just like the front matter shown ahead of the markdown content, the end matter is shown below.
```markdown You cool article content.
+++ [[comment]] author = "Bob" bio = "A developer" content = "The cool comment"
[[comment]] author = "Alice" bio = "" content = "Another cool comment" +++ ```
Zine provides some advanced code blocks to help you write articles.
~~~
urlpreview
https://github.com/zineland/zine
~~~
[x] Support RSS Feed
[x] Support render OGP meta
[ ] Support table of content
[ ] Support code syntax highlight
[ ] Support i18n
[ ] Generate word cloud for season
This project is licensed under the Apache-2.0 license.