Zine - a simple and opinionated tool to build your own magazine.
cargo install zine
or brew install zineland/tap/zine
or brew tap zineland/tap
, then brew 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 issues located │ └── issue-1 # The first issue directory │ ├── 1-first.md # The first markdown article in this issue │ └── zine.toml # The issue 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 issue's info.
```toml [site] url = "https://your-domain.com" name = "Your Zine Site Name" description = "" logo = "/path/to/favicon"
socialimage = "/path/to/socialimage"
locales
directory of this repo.locale = "en"
menu = [ { name = "About", url = "/about" }, { name = "Blog", url = "/blog" }, ]
[authors]
zine_team = { name = "Zine Team", editor = true, bio = "The Zine Team." }
[theme]
primarycolor = "#abcdef" secondarycolor = "#fff"
main_color = "#000"
link_color = "#e07312"
background_image = "/static/background.png"
head_template = "templates/head.html"
footer_template = "templates/footer.html"
articleextendtemplate = "templates/article-extend.html"
[markdown]
highlight_code = true
highlight_theme = "ayu-light"
[[issue]]
slug = "s1"
number = 1
title = "Issue 1"
path = "content/issue-1"
intro = "content/issue-1/intro.md"
[[issue]] slug = "s2" number = 2 title = "Issue 2" path = "content/issue-2" ```
zine.toml
The issue zine.toml
file list all your articles of this issue.
```toml [[article]]
slug = "1"
file = "1-first.md"
title = "First article"
author = "zine-team"
cover = ""
pub_date = "2022-03-20"
publish = true
featured = true
[[article]]
```
Zine will generate a dedicated profile page for each author declared in the root zine.toml
table.
```toml [authors]
alice = { name = "Alice", bio = "An engineer." }
bob = { name = "Bob", avatar = "/cool/avatar.png", bio = "An engineer." } ```
The path of an author page consists of
@
and author id, for example above, the path are@alice
and@bob
.If the author of an article hasn't declared in
[authors]
, no author page will be generated for that author.
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.
The author code is designed to render the avatar-name link on the markdown page.
The syntax is very simple, just write like this `@author_id`.
If the author_id
is declared in the [authors]
table of the root zine.toml
,
it will render the UI as expected, otherwise it fallback into the raw code UI.
~~~
urlpreview
https://github.com/zineland/zine
~~~
[x] Support RSS Feed
[x] Support render OGP meta
[x] Support l10n
[x] Support sitemap.xml
[x] Support code syntax highlight
[ ] Support table of content
[ ] Support i18n
[ ] Generate word cloud for issue
This project is licensed under the Apache-2.0 license.