从 cactus 主题分叉而来的 Hugo 个人博客主题,作者会持续与原版产生差异
cogito — Hugo 博客模板
作者 ethanjb
cogito 是一个基于 Hugo 的个人博客主题,从 cactus 主题分叉而来,采用 MIT 许可,通过站点配置调整配色、导航、首页与文章展示方式。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
目前有 1 张原始预览,可打开完整图片查看设计细节。
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
通过站点配置切换 dark、light、white、classic 四种配色主题
支持自定义 CSS、主菜单、首页描述、主内容区标题与首页文章数量控制
项目列表读取 data 目录下的 yaml、toml 或 json 数据文件,无数据文件时不显示
评论默认关闭且仅支持 disqus,RSS、MathJax、相关文章与代码高亮均需在配置中开启或调整
模板详细介绍
cogito 是一个面向个人博客的 Hugo 主题,由 ethanjb 维护,从 @monkeyWzr 的 cactus 主题分叉而来。作者在 README 中说明,因为对原 cactus 主题不完全满意,所以自行分叉维护,并提示随着时间推移,该主题会与原版差异越来越大。仓库 README 也标注部分工作仍在进行中,具体进度需查看 issues。
主题通过 Hugo 站点配置文件(如 config.toml)进行定制,可设置 colortheme(dark、light、white、classic)、自定义 CSS、主菜单、首页描述、主内容区(mainSection 与 mainSectionTitle)、首页文章数量或全部展示、标签总览、文章内联目录、项目列表与社交链接。项目列表读取 data 目录下的 yaml、toml 或 json 数据文件,未检测到数据文件时不显示该区块。
功能方面,评论默认关闭,启用后仅支持 disqus,可在站点配置或文章 front matter 中控制;RSS 默认不生成,需在 params 中开启;MathJax 支持站点级与文章级开关;代码高亮使用 Hugo 内置的语法高亮配置;分析统计使用 Hugo 内置的分析模板,可配置 Google Analytics 跟踪 ID;相关文章使用 Hugo 的 related content 配置。文章归档可分页,也可关闭分页按时间顺序展示全部文章。
安装方式为将仓库克隆到 Hugo 站点的 themes 目录,并在站点配置中把 theme 设为 cogito,随后用 hugo server 本地预览,再按 Hugo 文档自行选择部署方式。README 中列出的示例配置来自 exampleSite/config.toml。
适合你的项目吗?
适用场景
- 用 Hugo 搭建个人博客并希望调整首页文章数量、标签总览与内联目录
- 在博客中展示个人项目列表,并通过 data 数据文件维护项目条目
- 为文章启用 MathJax 公式、disqus 评论或 RSS 订阅
适合人群
- 使用 Hugo 并希望从 cactus 主题分叉版本起步的个人博客作者
- 需要按站点配置调整配色、导航与首页展示方式的用户
- 接受部分功能仍在开发中、愿意查看 issues 了解进度的使用者
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
将仓库克隆到 Hugo 站点的 themes 目录,并在站点配置中设置 theme = "cogito"
- 2
参考 README 的 Config 章节或 exampleSite/config.toml 完成站点配置
- 3
本地使用 hugo server 预览,部署方式按 Hugo 官方 Hosting & Deployment 文档自行选择
- 4
评论仅支持 disqus,需注册并配置 disqus shortname;RSS 与 MathJax 默认关闭,需在 params 中开启
- 5
演示图片、字体、图标等第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
- 评论功能默认关闭,需在站点配置中手动启用。
- 评论功能目前仅支持 disqus,其他评论引擎暂不可用。
- 使用 disqus 评论前需注册并获取 disqus shortname,属于外部服务账号要求。
- RSS 订阅源默认不生成,需在站点配置中开启。
- MathJax 公式支持需在站点配置中手动开启,默认不启用。
- 使用分析统计需自行配置 Google Analytics 跟踪 ID,涉及外部服务。
- 部分功能仍在开发中,尚未完成,需查看 issues 了解进度。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
Comments is disabled by default. Enable comments in your `.Site.Params`.
README 原文
**By now only disqus is supported in cogito.**
README 原文
Before using disqus, you need to register and get your [disqus shortname](https://help.disqus.com/en/articles/1717111-what-s-a-shortname).
README 原文
The rss feed is not generated by default. you can enable it in your site config:
README 原文
Cactus supports mathjax. Just add `mathjax` option in your site config:
README 原文
Set you tracking id in your site config.
README 原文
https://github.com/ethanjb/cogito/blob/master/LICENSEhttps://github.com/ethanjb/cogito/blob/master/README.mdSome works are still in progress. See the issues to see whats comming.
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-11。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较少 · 53 / 100
- 技术栈
- Hugo
- 网站类型
- 博客
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2021-09-29
- 截图检查日期
- 2026-10-11
目前没有记录演示链接。请依据仓库说明在本地评估;仅凭截图无法确认交互行为。
目录记录的主要技术栈是 Hugo。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
审核声明: [email protected] · 2026-10-13
查看当时使用的来源资料
SHA-256: adc3b49fe47c7ce51b40456caad950ac48ce579f3d090fde94641e2bbc729017
2026-10-11T21:32:54.070Z
来源文件 / 仓库
A hackable hugo theme for personal blog. Forked from [cactus](https://github.com/monkeyWzr/hugo-theme-cactus) created by [@monkeyWzr](https://github.com/monkeyWzr).
[Live demo on github pages](https://slashformotion.github.io/cogito).
Some works are still in progress. See the issues to see whats comming.
## Why this theme ?
I am not satisfied with original [cactus](https://github.com/monkeyWzr/hugo-theme-cactus) created by [@monkeyWzr](https://github.com/monkeyWzr). Check the original one out, it's may fit your requirements. This is not my case, I prefer to make my own fork.
***Be aware: with time, this theme will differ more and more from the original.***
## Install
1. Clone cogito to your hugo site's `themes` folder.
```
git clone https://github.com/slashformotion/cogito themes/cogito
```
2. Change your theme to cogito in your site config
```toml
# config.toml
theme = "cogito"
```
3. config your site. See [Config] or a [complete config sample](exampleSite/config.toml)
4. test your site
```
hugo server
```
5. publish your site in your prefered way. See hugo's doc: [Hosting & Deployment](https://gohugo.io/hosting-and-deployment/)
## Config
### Color themes
```toml
[params]
colortheme = "white" # dark, light, white, or classic
```
### Custom CSS
```toml
[params]
css = ["css/custom.css"]
```
You can add multiple custom stylesheets which will be loaded after the main theme css.
For example, the above line will load the CSS-file placed at `/static/css/custom.css`.
### Navigation
```toml
# Main menu which appears below site header.
[[menu.main]]
name = "Home"
url = "/"
weight = 1
[[menu.main]]
name = "All posts"
url = "/posts"
weight = 2
[[menu.main]]
name = "Tags"
url = "/tags"
weight = 3
[[menu.main]]
name = "About"
url = "/about"
weight = 4
```
### Homepage settings
* description: description will be displayed in the homepage. Markdown syntax is supported in the description string.
```toml
[params]
description = "Hugo is a general-purpose website framework. Technically speaking, Hugo is a static site generator. Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content. Since websites are viewed far more often than they are edited, Hugo is designed to provide an optimal viewing experience for your website’s end users and an ideal writing experience for website authors."
```
* set your main section (used as the link for the "writings" title on the homepage)
```toml
[params]
mainSection = "posts"
```
* change the default main section title from Writings, to something else:
```toml
[params]
mainSectionTitle = "Blog"
```
* Show only the 5 most recent posts (default)
```toml
[params]
showAllPostsOnHomePage = false
postsOnHomePage = 5
```
* show all posts
```toml
[params]
showAllPostsOnHomePage = true
postsOnHomePage = 5 # this option will be ignored
```
* show tagsoverview (default) or not
*
```toml
[params]
tagsOverview = true
```
* display the table of contents inline on blog posts, rather than as part of the navigation menu:
```toml
[params]
tocInline = true
```
* show projects list (default) or not.
```toml
[params]
showProjectsList = true
projectsUrl = "https://github.com/monkeyWzr"
```
Projects section will not be shown if no data file is detected. See [Projects list](#projects-list) below.
### Projects list
Create your projects data file `data/projects.yaml|toml|json`. Hugo support yaml, toml and json formats.
for former hexo cactus users: please assign your json array to a `list` key.
for example, `data/projects.json`:
```json
{
"list": [
{
"name":"Hexo",
"url":"https://hexo.io/",
"desc":"A fast, simple & powerful blog framework"
},
{
"name":"Font Awesome",
"url":"http://fontawesome.io/",
"desc":"The iconic font and CSS toolkit"
}
]
}
```
### Social media links
```toml
[[params.social]]
name = "github"
link = "https://github.com/monkeyWzr"
[[params.social]]
name = "email"
link = "[email protected]" # no need for "mailto:" at the start
[[params.social]]
name = "linkedin"
link = "https://www.linkedin.com/in/monkeywzr/"
```
The `name` key expects the name of a [Font Awesome icon](https://fontawesome.com/icons?d=gallery&s=brands).
### Copyright
Assign your copy right to `.Site.Copyright`. Cactus will append current year to the head.
TODO: Customizable copyright year
```toml
copyright = "Zeran Wu" # cogito theme will use site title if copyright is not set
```
### Comments
Comments is disabled by default. Enable comments in your `.Site.Params`.
```toml
[params]
[params.comments]
enabled = true
# engine = "disqus" # in progress
```
You can also enable/disable comments per post. in your posts' front matter, add:
```yaml
comments: true
```
The site config is ignored when `comments` option exists in front matter.
The default engine is disqus. **By now only disqus is supported in cogito.** I will add more options sooner or later. See [Comments Alternatives](https://gohugo.io/content-management/comments/#comments-alternatives)
Before using disqus, you need to register and get your [disqus shortname](https://help.disqus.com/en/articles/1717111-what-s-a-shortname). Assign your shortname in `.Site.disqusShortname`, or cogito will use `.Site.Title` by default.
```
disqusShortname = "wzr" # cogito will use site title if not set
```
### highlight
Use hugo's built-in [syntax highlighting](https://gohugo.io/getting-started/configuration-markup#highlight).
default config:
```toml
[markup]
[markup.highlight]
codeFences = true
guessSyntax = false
hl_Lines = ""
lineNoStart = 1
lineNos = false
lineNumbersInTable = true
noClasses = true
style = "monokai"
tabWidth = 4
```
### Analytics
Cactus uses hugo's built in analytics templates. Check [the official Hugo docs](https://gohugo.io/templates/internal#google-analytics) for details.
Set you tracking id in your site config.
```toml
googleAnalytics = "UA-XXXXXXXX-XX" # or G-XXXXXXXX if you are using Google Analytics v4 (gtag.js)
```
If you are using Google Analytics v3 (analytics.js), you can switch to asynchronous tracking by set `params.googleAnalyticsAsync` to `true`.
```toml
[params]
googleAnalyticsAsync = true # not required
```
### Related content
Cactus supports hugo's automatic related content. You can enable it in your site config:
```toml
[related]
includeNewer = true
threshold = 10
toLower = true
[[related.indices]]
name = "keywords"
weight = 80
[[related.indices]]
name = "title"
weight = 80
[[related.indices]]
name = "tags"
weight = 100
[[related.indices]]
name = "date"
weight = 60
pattern = "2006"
```
Please also check [Related Content](https://gohugo.io/content-management/related/) & [Better Relationships in Hugo with Hugo's Related Content](https://www.regisphilibert.com/blog/2018/04/hugo-optmized-relashionships-with-related-content/).
### RSS
The rss feed is not generated by default. you can enable it in your site config:
```toml
[params]
rss = true
```
The rss link will be `https://example.com/index.xml` assuming your `baseURL` is set to `https://example.com/`
Please also check [Configure RSS](https://gohugo.io/templates/rss/#configure-rss)
### Mathjax
Cactus supports mathjax. Just add `mathjax` option in your site config:
```toml
[params]
mathjax = true # not required
```
You can also enable/disable mathjax per post. In your posts' front matter, add:
```toml
mathjax = true # or false
```
The site config will be ignored when `mathjax` option exists in front matter.
### Archive
Pagination on posts archive can be disabled to show all posts in chronological order
```toml
[params]
showAllPostsArchive = true # or false (default)
```
## License
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

hugo-PaperMod
PaperMod 是 Hugo 生态里知名度较高的主题之一,定位很明确:给博客和轻量作品集站点提供一套干净、响应式的阅读界面。
Hugo · 作品集

LoveIt
❤️A clean, elegant but advanced blog theme for Hugo 一个简洁、优雅且高效的 Hugo 主题
Hugo · 博客

hugo-coder
A minimalist blog theme for hugo.
Hugo · 博客

blowfish
Personal Website & Blog Theme for Hugo
Hugo · 博客

hugo-paper
🪺 A simple, clean, customizable Hugo theme
Hugo · 博客

hextra
Hextra 是一个 Hugo 主题,定位在文档站与博客之间:既提供侧边栏导航、目录、面包屑、分页这类文档站结构,也能承载博客内容。
Hugo · 文档
