Zine个人杂志生成器

联合创作 · 2023-10-02 10:06

Zine - 一个帮助每个人构建一份属于自己的杂志的开源软件。

  • 移动优先。
  • 直观优雅的杂志设计。
  • 最佳阅读体验。
  • 主题可定制,扩展友好。
  • 支持 RSS 提要。
  • 支持 Open Graph 协议。
  • 输出成静态网站,可以在任何地方托管。

安装

cargo install zine

开始使用

运行zine new your-zine-site,你会得到以下目录:

$ 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 

运行zine serve以在本地计算机上预览你的 zine 站点:

$ cd your-zine-site $ zine serve ███████╗██╗███╗ ██╗███████╗ ╚══███╔╝██║████╗ ██║██╔════╝ ███╔╝ ██║██╔██╗ ██║█████╗ ███╔╝ ██║██║╚██╗██║██╔══╝ ███████╗██║██║ ╚████║███████╗ ╚══════╝╚═╝╚═╝ ╚═══╝╚══════╝ listening on http://127.0.0.1:3000 

运行zine build将你的 zine 网站构建为静态网站:

$ cd your-zine-site $ zine build Build success! The build directory is `build`. 

详细介绍

一个 Zine 项目主要由两个类型的zine.toml文件和一堆 markdown 文件组成。

项目 zine.toml

项目的 zine.toml文件描述了你的站点元数据和你所有的杂志季刊信息。

[site]
url = "https://your-domain.com"
name = "Your Zine Site Name"
description = ""
logo = "path/to/favicon"
# the locale to localize your Zine site. default to "en".
# Zine has builtin supported locales, please check the `locales` directory of this repo.
locale = "en"
# the menu tabs
menu = [
    { name = "About", url = "/about" },
    { name = "Blog", url = "/blog" },
]

# You can customize some theme elements in this section.
# All of those elements are optional.
[theme]
# the primary color
primary-color = "#abcdef"
secondary-color = "#fff"
# the main text color
main-color = "#000"
# the link color in article content
link-color = "#e07312"
# the background image
background-image = "/static/background.png"
# you can customize your footer here
footer-template = "templates/footer.html"

# Season 1
[[season]]
# the slug of this season: https://your-domain.com/s1
slug = "s1"
# the number of this season
number = 1
# season title
title = "Season 1"
# the directory path to parse this season, you should put
# your markdown files in this directory
path = "content/season-1"
# the introduction of this season. optional.
intro = "content/season-1/intro.md"

# Season 2
[[season]]
slug = "s2"
number = 2
title = "Season 2"
path = "content/season-2"

季刊 zine.toml

季刊 zine.toml档案列出了您本季的所有文章。

[[article]]
# the slug of this article. E.g: https://your-domain.com/s1/1
slug = "1"
# the markdown file path of this article
file = "1-first.md"
# the title of this article
title = "First article"
# the optional author of this article
author = ""
# the cover of this article
cover = ""
# the publish date of this article
pub_date = "2022-03-20"
# whether to publish this article or not
publish = true
# whether mark this article as a featured article. 
# the featured articles will be shown on the home page
featured = true

# Another article
[[article]]

高级功能

页面

`pages` 目录下的每个 markdown 文件都将被渲染为一个页面。就像这样直观:

$ 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 cool article content.

+++
[[comment]]
author = "Bob"
bio = "A developer"
content = "The cool comment"

[[comment]]
author = "Alice"
bio = ""
content = "Another cool comment"
+++

代码块

Zine 提供了一些高级代码块来帮助您撰写文章。

网址预览

```urlpreview https://github.com/zineland/zine ``` 

一些由 Zine 提供支持的酷杂志

浏览 5
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报