HugoBlog

hugo-blog-loveit-theme — Hugo Blog Template

By 3y3y3y-huaiji

A blog template based on Hugo and the LoveIt theme, with a TypeScript script that calls the GLM model on NVIDIA NIM to automatically generate posts from RSS feeds and deploy to Cloudflare Workers via GitHub Actions.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

3 previews
Desktop homepage1 / 3
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 3

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-03View source

What stands out

A quick read of the recorded project description.

01

Hugo static site with the LoveIt theme; the repository directly includes the themes/LoveIt theme source

02

The TypeScript script generate-ai-post.ts reads 19 Chinese and English technology RSS feeds and calls the GLM model to generate blog posts

03

The GitHub Actions workflow ai-blog-cron.yml triggers writing on a schedule and automatically commits back to the repository

04

cloudflare-deploy.yml runs Lint and Build after a push and deploys to Cloudflare Workers Assets

05

The theme includes Lunr.js local full-text search and supports dark/light mode and Mermaid diagrams

06

When a model call fails, the script exits with an explicit error and does not fall back to other models, making issues easier to locate

Template Details

This is a blog project built on the Hugo static site generator with the LoveIt theme; the repository contains both the theme source and the site configuration. It connects content production and content publishing into a single automated pipeline: scripts/generate-ai-post.ts reads RSS feeds from SSPAI, Solidot, Hacker News, TechCrunch, QbitAI, ifanr, Ruanyifeng Weekly, Ars Technica, and others, extracts topics, calls the GLM model on the NVIDIA API Catalog to write Markdown blog posts, and commits them back to GitHub; cloudflare-deploy.yml runs Lint and Build after a push and deploys to Cloudflare Workers Assets.

The repository offers two usage paths. The default path is automatic deployment to Cloudflare Workers Assets, which requires configuring NVIDIA_API_KEY, CLOUDFLARE_API_TOKEN, and CLOUDFLARE_ACCOUNT_ID in the GitHub repository Secrets, then triggering the Auto Generate AI Post workflow on a schedule via ai-blog-cron.yml or running it manually. The other path is local preview and development, which depends on Hugo Extended, Node.js, and pnpm; after installing dependencies, compile the theme resources, run the generation script, and preview with hugo server -D.

Limitations to note: if the model call times out or errors, the script exits with an error and does not fall back to polling other models; if RSS fetching fails, it degrades to built-in topics. Automatic writing depends on the external NVIDIA service and an API key, and deployment depends on a Cloudflare account; these external services are not covered by the MIT license. Third-party assets such as demo images, fonts, and icons must be checked against their respective licenses.

HugoBlog

Is it right for your project?

Use Cases

  • Build a technology news blog written automatically on a schedule by AI, without manual editing of each post
  • Use Hugo + LoveIt as a personal blog foundation and then connect an automated writing workflow as needed
  • Practice a complete generate content → commit → build → edge deploy pipeline in GitHub Actions
  • Preview the LoveIt theme locally and test the output format of the AI post generation script

Suitable For

  • Developers familiar with Hugo, Node.js, and pnpm who can configure GitHub Secrets themselves
  • Individuals or small teams who want to automate blog content production and Cloudflare Workers deployment
  • Users who need a ready-to-modify Hugo + LoveIt theme source as a starting point

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    Local development requires Hugo Extended, Node.js, and pnpm; run pnpm install first to install dependencies

  2. 2

    Create a .env file in the project root and write NVIDIA_API_KEY into it; this file is protected by .gitignore

  3. 3

    Automatic deployment requires configuring NVIDIA_API_KEY, CLOUDFLARE_API_TOKEN, and CLOUDFLARE_ACCOUNT_ID in the GitHub repository Secrets

  4. 4

    The local preview order is pnpm run build:theme, pnpm run generate:ai-post, then hugo server -D

  5. 5

    If RSS fetching fails, it degrades to built-in topics; if a model call fails, the script exits with an error and does not automatically fall back to another model

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version in a public repository under the MIT license; the free scope is the code of that version and does not mean that external services or third-party assets are free.

Must comply with when using

  • You may use, modify, commercialize, and distribute the code of this version for free.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the complete MIT license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • Automatic blog post writing depends on the external NVIDIA NIM service; you must register yourself and obtain an API key starting with nvapi-, and that service is not covered by the MIT license.
  • The default deployment path depends on a Cloudflare account and an API token with Workers edit permission, which are external service requirements.
  • If a model call fails, the script exits with an error and does not fall back to another model, interrupting the automatic writing workflow.
  • If RSS fetching fails, it degrades to built-in topics rather than real-time trending content.
  • Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
  • External services such as domains, hosting, databases, payments, or AI may incur additional charges.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

从 [NVIDIA Build](https://build.nvidia.com/) 获取的 `nvapi-` 开头密钥

Original README

| `CLOUDFLARE_API_TOKEN` | Cloudflare API Token(需要 Workers 编辑权限) |

Original README

模型调用超时或报错时,脚本将明确报错并退出流水线(不进行多模型轮询回退)

Original README

B -->|网络失败| D(降级为内置高价值话题)

Original README
https://github.com/3y3y3y-huaiji/hugo-blog-loveit-theme/blob/main/LICENSEhttps://github.com/3y3y3y-huaiji/hugo-blog-loveit-theme/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-03. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 75 / 100
Technologies
Hugo
Website type
Blog
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2026-08-21
Screenshot last checked
2026-10-03

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Hugo as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Review declaration: [email protected] · 2026-10-04

Inspect the recorded source material

SHA-256: 410a2d6292fc32452e96c4936e7a1c2f59394cbfc195c068285854a6f625d7b9

2026-10-03T21:16:49.441Z

Source file / repository
# 🤖 AI-Blog-Pulse | 全自动 AI 驱动的科技前沿博客

[![Hugo Version](https://badgen.net/badge/Hugo/v0.163.2/blue)](https://gohugo.io/)
[![Theme LoveIt](https://badgen.net/badge/Theme/LoveIt%20v0.3.1/orange)](https://github.com/dillonzq/LoveIt)
[![License MIT](https://badgen.net/badge/License/MIT/green)](LICENSE)
[![AI Engine](https://badgen.net/badge/AI%20Engine/NVIDIA%20NIM/blueviolet)](https://build.nvidia.com)
[![Deploy](https://github.com/3y3y3y-huaiji/hugo-blog-loveit-theme/actions/workflows/cloudflare-deploy.yml/badge.svg)](https://github.com/3y3y3y-huaiji/hugo-blog-loveit-theme/actions)

> 💡 **这是一个全自动运行、智能撰写、零人工干预的科技博客站。** 
> 
> 本项目基于 **Hugo (Extended)** 静态站点生成器和重构版 **LoveIt v0.3.1** 主题,通过对接 **NVIDIA API Catalog**(写作模型:**GLM 5.2**)与主流科技媒体 **RSS 订阅源**,实现全天候自动追踪全球科技热点、自主撰写深度技术分析博文,并全自动编译部署到 **Cloudflare Workers** 边缘网络。

🌐 **在线访问**:[https://berry.ccwu.cc/](https://berry.ccwu.cc/)

---

## 🌟 核心功能特性

* **🤖 GLM 5.2 单模型撰写**:博文由 **GLM 5.2**(`z-ai/glm-5.2`,NVIDIA NIM)单一模型撰写。
* **📡 动态热点抓取**:实时读取少数派(SSPAI)、Solidot、Hacker News、TechCrunch、量子位、爱范儿、阮一峰周刊、Ars Technica 等 19 个中英文优质科技 RSS 订阅源,自动追踪当日最火科技动态。
* **🛡️ 明确的失败语义**:模型调用超时或报错时,脚本将明确报错并退出流水线(不进行多模型轮询回退),便于及时发现与排查问题。
* **⚡ 优美的主题与极致性能**:
  * 主题升级至 **LoveIt v0.3.1**,采用 TypeScript 核心重写并自动 Babel 编译。
  * 内置 **Lunr.js** 搜索引擎,支持中文分词的毫秒级本地全文搜索。
  * 完美适配暗色/浅色模式、Mermaid 时序图绘制、移动端自适应。

---

## 📂 项目结构

```text
hugo-blog-loveit-theme/
├── .agents/
│   └── AGENTS.md             # AI Agent 统一行为规范
├── .github/
│   └── workflows/
│       ├── ai-blog-cron.yml  # 定时 AI 撰写 → 自动 Push → 触发部署
│       └── cloudflare-deploy.yml  # Push 触发:Lint → Build → 部署 Cloudflare
├── content/
│   ├── about/                # "关于"页面(含 Mermaid 架构图)
│   └── posts/                # 博客文章目录(含 AI 自动生成的博文)
├── scripts/
│   └── generate-ai-post.ts   # AI 博文自动生成核心 TypeScript 脚本
├── themes/
│   └── LoveIt/               # LoveIt 主题(已完成 TS 适配)
├── hugo.toml                 # Hugo 站点全局配置
├── package.json              # 依赖与构建脚本
├── wrangler.jsonc             # Cloudflare Workers Assets 配置
└── docs/                     # 项目开发文档
```

---

## ⚙️ 工作流架构图

```mermaid
graph TD
    A[每 4 小时 Cron 触发 / 手动触发] --> B(读取科技 RSS 订阅源)
    B -->|抓取成功| C(提取最新热门话题)
    B -->|网络失败| D(降级为内置高价值话题)
    C & D --> E[初始化 NVIDIA NIM API 客户端]
    E --> F{调用 GLM 5.2 撰写博文}
    F -->|模型成功响应| H(格式化为 Markdown 博文)
    F -->|超时或报错| Z(明确报错并退出流水线)
    H --> I(提交新博文并 Push 回 GitHub)
    I --> J[自动触发 Cloudflare 构建部署]
    J --> K[网站编译并发布上线]
```

---

## 🛠️ 部署教程

### 方案一:Cloudflare Workers Assets 自动部署(推荐)

这是本项目的默认部署方式,通过 GitHub Actions 全自动构建并部署到 Cloudflare 边缘网络。

#### 1. 配置仓库 Secrets

进入 GitHub 仓库 **Settings** → **Secrets and variables** → **Actions**,添加以下 Secrets:

| Secret 名称 | 说明 |
|-------------|------|
| `NVIDIA_API_KEY` | 从 [NVIDIA Build](https://build.nvidia.com/) 获取的 `nvapi-` 开头密钥 |
| `CLOUDFLARE_API_TOKEN` | Cloudflare API Token(需要 Workers 编辑权限) |
| `CLOUDFLARE_ACCOUNT_ID` | Cloudflare 账户 ID |

#### 2. 运行与验证

* 代码推送到 `main` 分支后,会自动触发构建并部署到 Cloudflare。
* 访问仓库的 **Actions** 标签页,选择 **Auto Generate AI Post**,点击 **Run workflow** 手动运行一次,即可看到 AI 生成文章并自动部署的全流程。

---

### 方案二:本地预览与开发

#### 1. 前置依赖

* [Hugo Extended](https://gohugo.io/getting-started/installing/) (v0.163.0+)
* [Node.js](https://nodejs.org/) (v20+)
* [pnpm](https://pnpm.io/)(包管理器,本项目已从 npm 迁移至 pnpm)

#### 2. 本地初始化

```bash
# 克隆仓库
git clone https://github.com/3y3y3y-huaiji/hugo-blog-loveit-theme.git
cd hugo-blog-loveit-theme

# 安装 Node 依赖
pnpm install
```

#### 3. 配置本地环境变量

在项目根目录创建 `.env` 文件(已被 `.gitignore` 保护):

```env
NVIDIA_API_KEY=nvapi-your-real-nvidia-api-key-here
```

#### 4. 本地测试运行

```bash
# 编译主题核心 JS 资源
pnpm run build:theme

# 调用 AI 撰写一篇新文章
pnpm run generate:ai-post

# 启动本地预览服务器
hugo server -D
```

---

## 📝 贡献与开发指南

1. **类型检查**:`pnpm run typecheck`
2. **代码风格检查**:`pnpm run lint`
3. **AI Agent 开发规范**:参见 [`.agents/AGENTS.md`](.agents/AGENTS.md)

## 📄 许可证

本项目采用 [MIT 许可证](LICENSE) - 允许个人及商业性免费修改使用。

## 💖 致谢

* [Hugo](https://gohugo.io/) - 世界上最快的静态网站生成框架。
* [LoveIt Theme](https://github.com/dillonzq/LoveIt) - 精致而强大的 Hugo 博客主题。
* [NVIDIA Build Platform](https://build.nvidia.com) - 提供丰富且支持 OpenAI 兼容 API 接入的先进大模型服务。
* [Cloudflare Workers](https://workers.cloudflare.com/) - 高性能全球边缘静态托管。
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.