docs: make Chinese README the default

This commit is contained in:
wehub-resource-sync
2026-07-13 09:02:22 +00:00
parent 0e3e5ba706
commit 5ea06fc899
+81 -75
View File
@@ -1,3 +1,9 @@
<!-- WEHUB_ZH_README -->
> [!NOTE]
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
> [English](./README.en.md) · [原始项目](https://github.com/gohugoio/hugo) · [上游 README](https://github.com/gohugoio/hugo/blob/HEAD/README.md)
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
[Clang]: https://clang.llvm.org/
[GCC]: https://gcc.gnu.org/
[Git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
@@ -31,168 +37,168 @@
<a href="https://gohugo.io/"><img src="https://raw.githubusercontent.com/gohugoio/gohugoioTheme/master/static/images/hugo-logo-wide.svg?sanitize=true" alt="Hugo" width="565"></a>
A fast and flexible static site generator built with love by [bep][], [spf13][], and [friends][] in Go.
一款由 [bep][][spf13][] [friends][] 使用 Go 语言倾心构建的快速、灵活的静态站点生成器(static site generator)。
---
[![GoDoc](https://godoc.org/github.com/gohugoio/hugo?status.svg)](https://godoc.org/github.com/gohugoio/hugo)
[![Tests on Linux, MacOS and Windows](https://github.com/gohugoio/hugo/workflows/Test/badge.svg)](https://github.com/gohugoio/hugo/actions?query=workflow%3ATest)
[![LinuxMacOS Windows 上的测试](https://github.com/gohugoio/hugo/workflows/Test/badge.svg)](https://github.com/gohugoio/hugo/actions?query=workflow%3ATest)
[![Go Report Card](https://goreportcard.com/badge/github.com/gohugoio/hugo)](https://goreportcard.com/report/github.com/gohugoio/hugo)
[Website][] | [Installation][] | [Documentation][] | [Support][] | [Contributing][] | <a rel="me" href="https://fosstodon.org/@gohugoio">Mastodon</a>
[Website(官网)][] | [Installation(安装)][] | [Documentation(文档)][] | [Support(支持)][] | [Contributing(贡献)][] | <a rel="me" href="https://fosstodon.org/@gohugoio">Mastodon</a>
## Overview
## 概述
Hugo is a [static site generator][] written in Go, optimized for speed and designed for flexibility. With its advanced templating system and fast asset pipelines, Hugo renders a complete site in seconds, often less.
Hugo 是一款使用 Go 语言编写的[静态站点生成器][static site generator],针对速度进行了优化,并兼顾灵活性设计。凭借其先进的模板系统和快速的资源管道(asset pipelines),Hugo 能在数秒内(通常更短)渲染一个完整的站点。
Due to its flexible framework, multilingual support, and powerful taxonomy system, Hugo is widely used to create:
得益于其灵活的框架、多语言支持和强大的分类系统(taxonomy system),Hugo 被广泛用于创建:
- Corporate, government, nonprofit, education, news, event, and project sites
- Documentation sites
- Image portfolios
- Landing pages
- Business, professional, and personal blogs
- Resumes and CVs
- 企业、政府、非营利、教育、新闻、活动和项目站点
- 文档站点
- 图片作品集
- 落地页(Landing pages
- 商业、专业和个人博客
- 简历和履历
Use Hugo's embedded web server during development to instantly see changes to content, structure, behavior, and presentation. Then deploy the site to your host, or push changes to your Git provider for automated builds and deployment.
在开发过程中,使用 Hugo 内置的 Web 服务器即可即时查看内容、结构、行为和展示的变化。然后将站点部署到你的主机上,或将更改推送到你的 Git 服务提供商以实现自动构建和部署。
Hugo's fast asset pipelines include:
Hugo 的快速资源管道包括:
- CSS Processing &ndash; Bundle, transform, minify, create source maps, perform SRI hashing, and integrate with PostCSS.
- Image processing &ndash; Convert, resize, crop, rotate, adjust colors, apply filters, overlay text and images, and extract metadata
- JavaScript bundling &ndash; Transpile TypeScript and JSX to JavaScript, bundle, tree shake, minify, create source maps, and perform SRI hashing.
- Sass processing &ndash; Transpile Sass to CSS, bundle, tree shake, minify, create source maps, perform SRI hashing, and integrate with PostCSS
- Tailwind CSS processing &ndash; Compile Tailwind CSS utility classes into standard CSS, bundle, tree shake, optimize, minify, perform SRI hashing, and integrate with PostCSS
- CSS 处理 &ndash; 打包、转换(transform)、压缩(minify)、生成 source maps、执行 SRI 哈希(SRI hashing),并与 PostCSS 集成。
- 图片处理 &ndash; 转换、调整尺寸、裁剪、旋转、调整颜色、应用滤镜、叠加文字和图片,以及提取元数据。
- JavaScript 打包 &ndash; TypeScript JSX 转译为 JavaScript,打包、摇树优化(tree shake)、压缩、生成 source maps,并执行 SRI 哈希。
- Sass 处理 &ndash; 将 Sass 转译为 CSS,打包、摇树优化、压缩、生成 source maps、执行 SRI 哈希,并与 PostCSS 集成。
- Tailwind CSS 处理 &ndash; Tailwind CSS 实用类(utility classes)编译为标准 CSS,打包、摇树优化、优化、压缩、执行 SRI 哈希,并与 PostCSS 集成。
And with [Hugo Modules][], you can share content, assets, data, translations, themes, templates, and configuration with other projects via public or private Git repositories.
借助 [Hugo Modules][],你可以通过公共或私有的 Git 仓库与其他项目共享内容、资源、数据、翻译、主题、模板和配置。
See the [features][] section of the documentation for a comprehensive summary of Hugo's capabilities.
请参阅文档的 [features][] 部分,了解 Hugo 功能的全面概述。
## Sponsors
## 赞助商
<p>&nbsp;</p>
<p float="left">
<a href="https://www.jetbrains.com/go/?utm_source=OSS&utm_medium=referral&utm_campaign=hugo" target="_blank"><img src="https://raw.githubusercontent.com/gohugoio/hugoDocs/master/assets/images/sponsors/goland.svg" width="200" alt="The complete IDE crafted for professional Go developers."></a>
<a href="https://www.jetbrains.com/go/?utm_source=OSS&utm_medium=referral&utm_campaign=hugo" target="_blank"><img src="https://raw.githubusercontent.com/gohugoio/hugoDocs/master/assets/images/sponsors/goland.svg" width="200" alt="专为专业 Go 开发者打造的完整 IDE。"></a>
&nbsp;&nbsp;&nbsp;
<a href="https://cloudcannon.com/hugo-cms/?utm_campaign=HugoSponsorship&utm_source=sponsor&utm_content=gohugo" target="_blank"><img src="https://raw.githubusercontent.com/gohugoio/hugoDocs/master/assets/images/sponsors/cloudcannon-cms-logo.svg" width="200" alt="CloudCannon"></a>
</p>
## Editions
## 版本
Hugo is available in several editions. Use the standard edition unless you need additional features.
Hugo 提供多个版本。除非你需要额外功能,否则请使用标准版(standard edition)。
Feature|standard|deploy|extended|extended/deploy
功能|standard|deploy|extended|extended/deploy
:--|:-:|:-:|:-:|:-:
Core features|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
Direct cloud deployment (1)|:x:|:heavy_check_mark:|:x:|:heavy_check_mark:
LibSass support (2)|:x:|:x:|:heavy_check_mark:|:heavy_check_mark:
核心功能|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
直接云端部署 (1)|:x:|:heavy_check_mark:|:x:|:heavy_check_mark:
LibSass 支持 (2)|:x:|:x:|:heavy_check_mark:|:heavy_check_mark:
(1) Deploy your site directly to a Google Cloud Storage bucket, an AWS S3 bucket, or an Azure Storage container. See&nbsp;[details][].
(1) 将你的站点直接部署到 Google Cloud Storage 存储桶、AWS S3 存储桶或 Azure Storage 容器。详见&nbsp;[details][]
(2) [Transpile Sass to CSS][] via embedded LibSass. Note that embedded LibSass was deprecated in v0.153.0 and will be removed in a future release. Use the [Dart Sass][] transpiler instead, which is compatible with any edition.
(2) 通过内嵌的 LibSass [将 Sass 转译为 CSS][transpile sass to css]。请注意,内嵌 LibSass 自 v0.153.0 起已弃用,并将在未来版本中移除。请改用 [Dart Sass][] 转译器,该转译器兼容所有版本。
## Installation
## 安装
Install Hugo from a [prebuilt binary][], package manager, or package repository. Please see the installation instructions for your operating system:
从[预编译二进制文件][prebuilt binary]、包管理器或包仓库安装 Hugo。请参阅适用于你操作系统的安装说明:
- [macOS][]
- [Linux][]
- [Windows][]
- [DragonFly BSD, FreeBSD, NetBSD, and OpenBSD][]
- [DragonFly BSDFreeBSDNetBSD OpenBSD][]
## Build from source
## 从源码构建
To build Hugo from source you must install:
要从源码构建 Hugo,你必须安装:
1. [Git][]
1. [Go][] version 1.26.0 or later
1. [Go][] 1.26.0 或更高版本
### Standard edition
### 标准版(Standard edition
To build and install the standard edition:
构建并安装标准版:
```sh
CGO_ENABLED=0 go install github.com/gohugoio/hugo@latest
```
### Deploy edition
### 部署版(Deploy edition
To build and install the deploy edition:
构建并安装部署版:
```sh
CGO_ENABLED=0 go install -tags withdeploy github.com/gohugoio/hugo@latest
```
### Extended edition
### 扩展版(Extended edition
To build and install the extended edition, first install a C compiler such as [GCC][] or [Clang][] and then run the following command.
构建并安装扩展版,首先安装 C 编译器,如 [GCC][] [Clang][],然后运行以下命令。
```sh
CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest
```
### Extended/deploy edition
### 扩展/部署版(Extended/deploy edition
To build and install the extended/deploy edition, first install a C compiler such as [GCC][] or [Clang][] and then run the following command.
构建并安装扩展/部署版,首先安装 C 编译器,如 [GCC][] [Clang][],然后运行以下命令。
```sh
CGO_ENABLED=1 go install -tags extended,withdeploy github.com/gohugoio/hugo@latest
```
## Star History
## Star 历史
[![Star History Chart](https://api.star-history.com/svg?repos=gohugoio/hugo&type=Timeline)](https://star-history.com/#gohugoio/hugo&Timeline)
## Documentation
## 文档
Hugo's [documentation][] includes installation instructions, a quick start guide, conceptual explanations, reference information, and examples.
Hugo 的[文档][documentation]包含安装说明、快速入门指南、概念说明、参考信息和示例。
Please submit documentation issues and pull requests to the [documentation repository][].
请将文档相关的问题和 Pull Request 提交到[文档仓库][documentation repository]
## Support
## 支持
Please **do not use the issue queue** for questions or troubleshooting. Unless you are certain that your issue is a software defect, use the [forum][].
请**不要使用 issue 队列**提问或进行故障排查。除非你确定你的问题是软件缺陷,否则请使用[论坛][forum]
Hugo's [forum][] is an active community of users and developers who answer questions, share knowledge, and provide examples. A quick search of over 20,000 topics will often answer your question. Please be sure to read about [requesting help][] before asking your first question.
Hugo 的[论坛][forum]是一个活跃的用户和开发者社区,大家在这里回答问题、分享知识并提供示例。快速搜索超过 20,000 个主题往往就能回答你的问题。在提出第一个问题之前,请务必阅读有关[请求帮助][requesting help]的说明。
## Contributing
## 贡献
You can contribute to the Hugo project by:
你可以通过以下方式为 Hugo 项目做出贡献:
- Answering questions on the [forum][]
- Improving the [documentation][]
- Monitoring the [issue queue][]
- Creating or improving [themes][]
- Squashing [bugs][]
- 在[论坛][forum]上回答问题
- 完善[文档][documentation]
- 关注 [issue 队列][issue queue]
- 创建或改进[主题][themes]
- 修复 [bugs][]
Please submit documentation issues and pull requests to the [documentation repository][].
请将文档相关的问题和 Pull Request 提交到[文档仓库][documentation repository]
If you have an idea for an enhancement or new feature, create a new topic on the [forum][] in the "Feature" category. This will help you to:
如果你有改进或新功能的点子,请在[论坛][]的"Feature"分类中创建一个新话题。这将帮助你:
- Determine if the capability already exists
- Measure interest
- Refine the concept
- 确认该功能是否已存在
- 评估兴趣度
- 完善概念
If there is sufficient interest, [create a proposal][]. Do not submit a pull request until the project lead accepts the proposal.
如果兴趣足够,再[撰写提案][]。在项目负责人接受提案之前,请勿提交拉取请求。
For a complete guide to contributing to Hugo, see the [Contribution Guide](CONTRIBUTING.md).
关于 Hugo 贡献的完整指南,请参阅[贡献指南](CONTRIBUTING.md)
## License
## 许可证
For the Hugo source code, see [LICENSE](/LICENSE).
Hugo 源代码的许可证见 [LICENSE](/LICENSE)
We also bundle some libraries in binary/WASM form:
我们还以二进制/WASM 形式捆绑了一些库:
- [libwebp](https://github.com/webmproject/libwebp), [BSD-3-Clause license](https://github.com/webmproject/libwebp?tab=BSD-3-Clause-1-ov-file#readme)
- [Katex](https://github.com/KaTeX/KaTeX), [MIT license](https://github.com/KaTeX/KaTeX?tab=MIT-1-ov-file#readme)
- [QuickJS](https://github.com/bellard/quickjs?tab=License-1-ov-file#readme), [License](https://github.com/bellard/quickjs?tab=License-1-ov-file#readme)
- [libwebp](https://github.com/webmproject/libwebp),)[BSD-3-Clause 许可证](https://github.com/webmproject/libwebp?tab=BSD-3-Clause-1-ov-file#readme))
- [Katex](https://github.com/KaTeX/KaTeX),)[MIT 许可证](https://github.com/KaTeX/KaTeX?tab=MIT-1-ov-file#readme))
- [QuickJS](https://github.com/bellard/quickjs?tab=License-1-ov-file#readme),)[许可证](https://github.com/bellard/quickjs?tab=License-1-ov-file#readme))
## Dependencies
## 依赖
Hugo stands on the shoulders of great open source libraries. Run `hugo env --logLevel info` to display a list of dependencies.
Hugo 站在众多优秀开源库的肩膀上。运行 `hugo env --logLevel info` 可查看依赖列表。
<details>
<summary>See current dependencies</summary>
<summary>查看当前依赖</summary>
```text
github.com/BurntSushi/locker="v0.0.0-20171006230638-a6e239ea1c69"