GithubHelp home page GithubHelp logo

ischaojie / willow Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 1.0 225 KB

A zola blog theme: willow

Home Page: https://willow.chaojie.fun

License: MIT License

JavaScript 4.88% HTML 77.20% SCSS 1.43% CSS 16.49%
rust static-site zola zola-theme blog-theme

willow's Introduction

willow

你好哇,Willow 是为静态站点生成工具 zola 制作的一款主题。没有 Tabler 这么漂亮的开源 UI 套件,以我丑陋的审美也没法做出好看的主题。感谢 Tabler 以及其他第三方库,感谢开源!

willow 的一些主要功能:

  • blog 通用的功能,文章列表、标签页、关于页面、RSS 等等。
  • 支持 giscus 评论系统。
  • 支持摄影作品页面(待支持点赞。
  • 支持 memos 动态(我称之为碎碎念。

使用

使用 willow 前先熟悉下 zola 的用法。

安装

确保使用 zola init myblog 创建了项目,然后将 willow 克隆到本地 themes 文件下:

cd themes
git submodule add https://github.com/ischaojie/willow.git themes/willow

之后在 config.toml 文件中指定 theme 为 willow:

theme = "willow"

配置

zola 支持在 extra 字段增加自定义的配置项,willow 的所有配置均以 extra.willow 开头,基础配置包括:

  • 首页展示的文章数量

    [extra.willow]
    show_article_num = 10
  • 导航栏的顺序 目前支持的导航栏有:articlestagsaboutphotographymemos。且 home 默认为首位。

    Notice

    注意增加对应导航的翻译:

    [languages.zh-CN.translations]
    language_name = "中文"
    home = "首页"
    articles = "文章"
    tags = "标签"
    photography = "摄影"
    about = "关于"
    memos = "碎碎念"
    [extra.willow]
    nav = ["articles", "tags", "about"]
  • Google Analytics

    [extra.willow]
    google_analytics = "G-XXX"

社交账号

Willow 目前支持的社交账号有:twitterdoubangithub(如有其他需求,欢迎 issue)。配置参考:

[extra.willow.social]
twitter = "chaojie_cn"
douban = "218724191"
github = "ischaojie"

所有配置项均为账号 id。

giscus

willow 目前仅支持 giscus 评论系统(如有其他需求,欢迎 issue)。首先参考 giscus 的文档,生成自己的 giscus 配置。然后在 config.toml 中增加对应的配置项:

[extra.willow.comment.giscus]
repo = "<>"
repo_id = "<>"
category = "<>"
category_id = "<>"
mapping = "<>"

memos

memos 是一个轻量级的、自托管的备忘录(动态)中心。

参考官方文档搭建自己的 memos 服务,然后在 config.toml 中增加对应的配置项:

[extra.willow.memos]
# 每次加载展示的 memo 数量
show_num = 10
# API 接口
api = "https://momo.chaojie.fun/api/memo/all"

Photography

willow 支持摄影作品页面,您可以自定义或者使用其他平台(目前仅 unsplash)。配置参考:

[extra.willow.photography]

# 类型:使用 unsplash 中的照片,置空展示 photos 中的照片。
type = "unsplash"
# client id: 申请 unsplash 开发者账号,获取 client id
unsplash_client_id = "Nzn8Fo0oteghIaTz-B0AAH3GQ-7BH2XNqWiJpE1AsB8"
# 要展示的作者
unsplash_author = "chaojie"
photos = [
    "https://file.chaojie.fun/photography/过春天.jpg",
    "https://file.chaojie.fun/photography/lan.jpg",
]

完整配置参考

可复制 config.toml,根据需要修改

# --- willow config example --- #

[extra.willow]
# The number of articles to show on the home page
show_article_num = 10

# The order of the navigation bar, home is the first by default
# current supported nav: articles, tags, about, photography, memos
nav = ["articles", "memos", "photography", "tags", "about"]


# --- social accounts --- #
# currently supported: twitter, douban, github

[extra.willow.social]
twitter = "chaojie_cn"
douban = "218724191"
github = "ischaojie"

# --- photography --- #

[extra.willow.photography]
# Put the photos you want to show on the photography page here
photos = [
    "https://file.chaojie.fun/photography/过春天.jpg",
    "https://file.chaojie.fun/photography/lan.jpg",
]

# --- giscus --- #
# see https://giscus.app/ for more details

[extra.willow.comment.giscus]
repo = "ischaojie/willow"
repo_id = "R_kgDOJSaQFQ"
category = "Announcements"
category_id = "DIC_kwDOJSaQFc4CVjI_"
mapping = "title"

# --- memos --- #

[extra.willow.memos]
show_num = 10

# The memo api
api = "https://momo.chaojie.fun/api/memo/all"

License

MIT

willow's People

Contributors

ischaojie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

syukkic zhimoe

willow's Issues

workflow 和vercel deploy错误

您好,很喜欢您在v2上分享的主题,今天下载下来自己改了改,workflow这一步出了错误,如下图所示,使用的是和您一样的文件
image

此外我也试了vercel部署,出现如下错误,环境变量,是不是需要指定zola版本?
image

另外还想问下,zola 是否有指令会像hugo,hexo一样,在本地就直接生成包含所有html的public目录呢?

希望作者大大有空的时候解答一下

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.