Hugo 主题
Kidlat Hugo 主题
Kidlat 是一个低带宽、纯文本的 Hugo 主题。
此主题经验证可与 Hugo 版本 v0.110.0–v0.121.2 兼容。
特性
- 超轻量级
- 响应式布局
- 自动亮/暗模式(通过媒体查询)
- 无框架
- 无 javascript
- 全文 RSS 订阅
- 在 PageSpeed Insights 上,性能、可访问性、最佳实践和 SEO 得分均为 100%
示例站点
此主题在 Kidlat News 中使用。我们网站的 Github 存储库是公开的。
安装
- 将
kidlat
文件夹复制到你站点的themes
文件夹中。
themes/
└── kidlat
- 将主题添加到站点配置文件
config.yaml
中。
theme: kidlat
配置
1. 更改默认配置
将 hugo.yaml
中的默认主题配置复制并更改到站点配置文件 config.yaml
中
baseURL: https://example.org/ # Change to your website URL
title: Example News & Current Events # Change to your website title
languageCode: en-us
theme: kidlat
params:
short_title: Example News # Change to your website short title
display_name: EXAMPLE # Change to your website display name
license: Creative Commons BY-SA 4.0 # Change to your website license
license_url: https://creativecommons.org/licenses/by-sa/4.0/deed.en # Change to your license URL
description: "Example News is the trusted site for news and current events." # Change to your website description
logo: "/example-news.jpg" # The logo should be inside your static folder
footer: <span><a href="http://www.example.org/">This is the footer text.</a></span> <span><a href="#top">▲</a></span> # Change to your footer text and link
2. 将 css
文件夹放入你的 static
文件夹中
将 css
文件夹及其内容移动或复制到你站点的 static
文件夹。你的 static
文件夹应如下所示。
static/
└── css
├── kidlat.css
└── README.md
3. 在前言中指定项目
有许多可选的前言项目可以指定。
content_type
用于 schema.org 元数据。最常见的类型是Article
、NewsArticle
和BlogPosting
。attribution
用于将图像归因于其来源并指定其许可证。display_license
若要在每篇文章末尾显示站点许可证(以及指定的attribution
),请将其设置为true
。images
用于指定图像元数据。当文章在社交媒体上共享时,将使用此图像。xurl
如果在 Twitter 上共享,则为推文的 URL。如果指定了 URL,则在文章发布日期后会显示在 X 上评论
。
许可证
Kidlat 主题在 Apache License 2.0 许可下获得许可。