Skip to content
0

快速开始

快速开始

环境要求

  • Hugo Extended v0.150.0 或更高版本
  • Go v1.21+ (用于构建工具)
  • Git (用于版本管理)

安装 Hugo

Linux/macOS:

bash
# 使用 Homebrew
brew install hugo

# 或下载二进制文件
wget https://github.com/gohugoio/hugo/releases/download/v0.150.0/hugo_extended_0.150.0_linux-amd64.tar.gz
tar -xzf hugo_extended_0.150.0_linux-amd64.tar.gz
sudo mv hugo /usr/local/bin/

验证安装:

bash
hugo version
# 输出应包含 "+extended"

克隆项目

bash
git clone https://github.com/yourusername/hugo-teeker-theme.git
cd hugo-teeker-theme

安装依赖

bash
# 安装 Go 工具依赖
make install-deps

启动开发服务器

bash
# 方式1: 使用 Makefile(推荐)
make dev

# 方式2: 直接使用 Hugo
./hugo server --source=hugo-teek-site --bind=0.0.0.0 --port=8080 --buildDrafts

# 方式3: 快速预览(跳过预生成)
make quick

访问 http://localhost:8080 查看网站。

创建第一篇文章

bash
# 创建博客文章
./hugo new posts/my-first-post.md --source=hugo-teek-site

# 创建文档页面
./hugo new docs/11.运维/docker-tutorial.md --source=hugo-teek-site

编辑生成的 Markdown 文件,修改 Front Matter 和内容:

markdown
---
title: "我的第一篇文章"
date: 2025-10-23T18:00:00+08:00
draft: false
description: "这是一篇示例文章"
categories: ["技术"]
tags: ["Hugo", "博客"]
---

## 你好,世界!

这是我的第一篇博客文章。

保存后,页面会自动刷新显示新文章。

最近更新