内置环境音播放器,提供咖啡馆、雨声、壁炉三种音效,可开关并调节音量
loficode-hugo-theme — Hugo 启动器模板
作者 madebydia
LofiCode 是一款 Hugo 博客主题,以 lo-fi 复古视觉为基调,内置环境音播放器、明暗模式切换、实时搜索与文章目录,适合个人开发者或创作者搭建氛围感博客。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 3
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
明暗模式自动检测并支持手动切换
全站实时搜索与文章目录自动生成
代码块语法高亮并带复制功能,阅读时长以咖啡杯图标呈现
SPA 式页面导航,移动端优先的响应式布局
支持 GitHub、Twitter/X、LinkedIn、Email、Mastodon、YouTube、Instagram、Facebook 社交链接
模板详细介绍
LofiCode 是作者 @madebydia 发布的 Hugo 主题,定位为面向开发者与创作者的博客模板。视觉上采用暖色渐变、复古排版与细微动效,整体呈现 lo-fi 氛围;功能上提供明暗模式自动检测与手动切换、全站实时搜索、文章目录自动生成、代码块高亮与复制、以咖啡杯表示阅读时长,以及 SPA 式页面导航。主题内置环境音播放器,包含咖啡馆、雨声和壁炉三种音效,可通过底部控制栏开关并调节音量。内容结构以 content 目录下的首页、关于页、联系页和 posts 文章目录为主,支持在 front matter 中设置副标题、标签、featured 标记和 mood 徽章,并提供 coffee-break 短代码用于在正文中插入休息提示块。社交链接支持 GitHub、Twitter/X、LinkedIn、Email、Mastodon、YouTube、Instagram、Facebook,仅显示已配置的平台。主题使用 CSS 自定义属性管理配色,可在自有 CSS 中覆盖。开发与构建需要 Hugo Extended 0.112.0 或更高版本,README 另列出 Node.js 作为开发工具依赖。主题代码采用 MIT 许可,但内置环境音来自 Freesound,分别使用 Creative Commons 0 与 Attribution 4.0 许可,演示图片、字体、图标等第三方素材需按各自许可单独核对。
适合你的项目吗?
适用场景
- 搭建带有 lo-fi 复古氛围的个人技术博客
- 为开发者或创作者建立包含关于页与联系页的个人站点
- 在阅读页面中提供环境音与明暗切换以营造沉浸式阅读体验
- 需要实时搜索、文章目录和代码高亮的技术内容发布
适合人群
- 使用 Hugo 并希望快速套用现成博客主题的开发者
- 偏好复古 lo-fi 视觉风格的个人博主或创作者
- 需要环境音播放、明暗模式和实时搜索等前端功能的静态站点
- 能接受自行核对第三方素材许可并调整配色的使用者
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
将仓库克隆或作为 Git 子模块添加到 Hugo 站点的 themes/loficode 目录
- 2
在 hugo.toml 中设置 theme = "loficode",并按需配置 params.author、params.profile、params.social 与 menu.main
- 3
使用 hugo new posts/my-first-post.md 创建文章,通过 hugo server -D 本地预览
- 4
构建环境需 Hugo Extended 0.112.0 或更高版本,README 另列出 Node.js 作为开发工具依赖
- 5
主题代码为 MIT 许可,但内置环境音来自 Freesound(CC0 与 Attribution 4.0),演示图片、字体、图标等第三方素材需按各自许可核对
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 主题内置的环境音效并非采用 MIT 许可,而是分别使用 Creative Commons 0 与 Attribution 4.0 许可。若再分发或商用这些音频,需遵守对应 CC 条款,其中 Attribution 4.0 要求署名原作者。
- Fire.wav 壁炉音效由 TheBoatman 提供,采用 CC Attribution 4.0,使用时必须保留对原作者的署名,不能仅以 MIT 许可处理。
- Cafe 1 咖啡馆音效由 Rylius 提供,采用 CC Attribution 4.0,使用时必须保留对原作者的署名,不能仅以 MIT 许可处理。
- 构建与运行需要 Hugo Extended 0.112.0 或更高版本,普通版 Hugo 可能无法正常构建该主题。
- README 将 Node.js 列为开发工具依赖,若需使用相关开发工具则需另行安装 Node.js 环境。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
The ambient sounds included with this theme are provided under Creative Commons licenses:
README 原文
- **Fire.wav** by TheBoatman - [Freesound](https://freesound.org/s/347706/) - License: Attribution 4.0
README 原文
- **Cafe 1** by Rylius - [Freesound](https://freesound.org/s/165280/) - License: Attribution 4.0
README 原文
- Hugo Extended v0.112.0 or later
README 原文
https://github.com/madebydia/loficode-hugo-theme/blob/main/LICENSEhttps://github.com/madebydia/loficode-hugo-theme/blob/main/README.md- Node.js (for development tools)
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-03。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- Hugo Themes
- 资料与维护参考分
- 资料较完整 · 87 / 100
- 技术栈
- Hugo
- 网站类型
- 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-06-25
- 截图检查日期
- 2026-10-03
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Hugo。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
审核声明: [email protected] · 2026-10-04
查看当时使用的来源资料
SHA-256: 6e6f9b49a59fcba7a3bc994e86d9f9a991701af04e04b6aa874a3b8fa224b13e
2026-10-03T20:33:31.985Z
来源文件 / 仓库# LofiCode Hugo Theme
Built by [@madebydia](https://x.com/madebydia)
A cozy, lo-fi inspired Hugo theme perfect for developers and creatives who want to create a warm, inviting blog with a retro aesthetic and modern functionality.

## ✨ Features
- **🎵 Ambient Sounds**: Built-in ambient sound player with coffee shop, rain, and fireplace sounds
- **🌙 Dark/Light Mode**: Automatic theme detection with manual toggle
- **📱 Fully Responsive**: Beautiful on all devices from mobile to desktop
- **🔍 Live Search**: Real-time search functionality across all posts
- **📖 Table of Contents**: Auto-generated TOC for blog posts
- **🎨 Syntax Highlighting**: Beautiful code blocks with copy functionality
- **☕ Coffee Theme**: Reading time displayed with coffee cups
- **🚀 SPA Navigation**: Smooth single-page app experience
- **♿ Accessible**: WCAG compliant with proper ARIA labels
- **⚡ Performance**: Optimized for speed and SEO
## 🎨 Design Philosophy
LofiCode embraces the cozy, nostalgic feeling of lo-fi aesthetics while maintaining modern web standards. The theme features:
- Warm, gradient backgrounds reminiscent of sunset vaporwave
- Retro-inspired typography with modern readability
- Subtle animations and hover effects
- Coffee-themed reading indicators
- Ambient sound integration for a cozy coding atmosphere
## 🚀 Quick Start
### 1. Install the Theme
```bash
# Clone into your Hugo site's themes directory
git clone https://github.com/madebydia/loficode-hugo-theme.git themes/loficode
# Or add as a Git submodule
git submodule add https://github.com/madebydia/loficode-hugo-theme.git themes/loficode
```
### 2. Configure Your Site
Add the theme to your `hugo.toml`:
```toml
theme = "loficode"
[params]
description = "Your site description"
[params.author]
name = "Your Name"
image = "images/profile.png"
# Profile section
[params.profile]
name = "Your Name"
tagline = "Your tagline here"
photo = "/images/profile.png"
# Social links - Supported platforms: github, twitter, linkedin, email, mastodon, youtube, instagram, facebook
[params.social]
github = "madebydia"
twitter = "madebydia"
# linkedin = "your-linkedin-username"
# email = "[email protected]"
# mastodon = "https://mastodon.social/@yourusername"
# youtube = "https://youtube.com/@yourusername"
# instagram = "your-instagram-username"
# facebook = "your-facebook-username"
# Navigation menu
[[menu.main]]
name = "About"
url = "/about/"
weight = 10
[[menu.main]]
name = "Contact"
url = "/contact/"
weight = 20
```
### 3. Create Content
```bash
# Create your first post
hugo new posts/my-first-post.md
```
### 4. Run Your Site
```bash
hugo server -D
```
## 📁 Content Structure
```
content/
├── _index.md # Homepage content
├── about.md # About page
├── contact.md # Contact page
└── posts/ # Blog posts
├── post-1.md
└── post-2.md
```
## 🎵 Ambient Sounds
The theme includes three ambient sound options:
- **☕ Coffee Shop**: Gentle café ambience
- **🌧️ Rain**: Soft rain sounds
- **🔥 Fireplace**: Crackling fire
Sounds can be toggled on/off and volume adjusted via the bottom control bar.
## 🔗 Social Links
LofiCode supports multiple social media platforms with beautiful icons. Add any combination of the following to your `hugo.toml`:
### Supported Platforms
- **GitHub** - `github = "madebydia"`
- **Twitter/X** - `twitter = "your-username"`
- **LinkedIn** - `linkedin = "your-linkedin-username"`
- **Email** - `email = "[email protected]"`
- **Mastodon** - `mastodon = "https://mastodon.social/@yourusername"`
- **YouTube** - `youtube = "https://youtube.com/@yourusername"`
- **Instagram** - `instagram = "your-instagram-username"`
- **Facebook** - `facebook = "your-facebook-username"`
### Configuration Example
```toml
[params.social]
github = "madebydia"
twitter = "madebydia"
linkedin = "your-linkedin-username"
email = "[email protected]"
```
Only the platforms you configure will be displayed. The theme automatically handles the appropriate URL formatting and icons for each platform.
## 🎨 Customization
### Colors and Themes
The theme uses CSS custom properties for easy customization. Override these in your own CSS:
```css
:root {
--accent-primary: #FF006B;
--accent-secondary: #00CED1;
--accent-tertiary: #FF7F50;
/* ... more variables */
}
```
### Front Matter Options
```yaml
---
title: "Your Post Title"
subtitle: "Optional subtitle"
date: 2025-01-01
tags: ["hugo", "theme", "lofi"]
featured: true # Highlights the post
mood: "cozy" # Adds a mood badge
---
```
### Shortcodes
#### Coffee Break
Add cozy breaks in your content:
```markdown
{{< coffee-break title="Take a Break" >}}
Time for a coffee break! ☕ Grab your favorite mug and enjoy a moment of calm.
{{< /coffee-break >}}
```
## 📱 Responsive Design
LofiCode is built mobile-first and looks great on:
- 📱 Mobile phones (320px+)
- 📱 Tablets (768px+)
- 💻 Laptops (1024px+)
- 🖥️ Desktops (1200px+)
## ⚡ Performance
- Optimized CSS with minimal dependencies
- Lazy loading for images
- Efficient JavaScript with no heavy frameworks
- Fast search implementation
- Optimized web fonts
## 🔧 Development
### Prerequisites
- Hugo Extended v0.112.0 or later
- Node.js (for development tools)
### Local Development
```bash
# Clone the repository
git clone https://github.com/madebydia/loficode-hugo-theme.git
cd loficode-hugo-theme
# Install dependencies (if any)
npm install
# Run Hugo server
hugo server -D
```
## 🎵 Sound Credits
The ambient sounds included with this theme are provided under Creative Commons licenses:
- **Soft Rain Loop** by _lynks - [Freesound](https://freesound.org/s/595717/) - License: Creative Commons 0
- **Fire.wav** by TheBoatman - [Freesound](https://freesound.org/s/347706/) - License: Attribution 4.0
- **Cafe 1** by Rylius - [Freesound](https://freesound.org/s/165280/) - License: Attribution 4.0
## 🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
### Development Guidelines
1. Follow the existing code style
2. Test your changes thoroughly
3. Update documentation as needed
4. Ensure accessibility standards are maintained
## 📄 License
This theme is released under the [MIT License](LICENSE).
---
Made with ☕ and 💜 for the Hugo community.
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

hugo-xmin
eXtremely Minimal Hugo theme: about 140 lines of code in total, including HTML and CSS (with no dependencies)
Hugo · 启动器

hugo-theme-gallery
Gallery Theme for Hugo
Hugo · 启动器

reveal-hugo
📽️ Create rich HTML-based presentations with Hugo and Reveal.js
Hugo · 启动器

anatole
Anatole is a minimalistic two-column theme for Hugo.
Hugo · 启动器

hugo-theme-diary
Moments piled up. A Hugo theme ported from SumiMakito/hexo-theme-Journal.
Hugo · 启动器

risotto
A minimalist, responsive hugo theme inspired by terminal ricing aesthetics.
Hugo · 启动器
