Hugo

Hugo 是最流行的开源静态网站生成器之一。凭借其惊人的速度和灵活性,Hugo 让建站再次充满乐趣。「Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again.」

Github stars Tracking Chart

Hugo

bepspf13朋友们Go 语言倾情打造的一款快速灵活的静态网站生成器。

网站 | 论坛 | 文档 | 安装指南 |

概述

Hugo 是一个用 Go 编写的静态 HTML 和 CSS 网站生成器。它针对速度、易用性和可配置性进行了优化。Hugo 将一个包含内容和模板的目录,渲染成一个完整的 HTML 网站。

Hugo 依靠 Markdown 文件与前页(front matter)作为元数据,你可以从任何目录运行 Hugo。这对于共享主机和其他你没有特权账户的系统来说,效果很好。

Hugo 可以在几分之一秒的时间内渲染一个中等大小的典型网站。一个好的经验法则是每块内容的渲染时间在1毫秒左右。

Hugo 的设计适用于任何类型的网站,包括博客、tumbles 和文档。

支持的架构

目前,我们为 Windows、Linux、FreeBSD、NetBSD、DragonFly BSD、Open BSD、macOS(Darwin)和 Android 的 x64、i386 和 ARM 架构提供了预构建的 Hugo 二进制文件。

Hugo 也可以在任何 Go 编译器工具链可以运行的地方从源码编译,例如在其他操作系统上,包括 Plan 9 和 Solaris。

完整的文档可以在 Hugo文档 中找到。

选择安装方式

如果您想使用 Hugo 作为您的站点生成器,只需安装 Hugo 二进制文件即可。 Hugo 二进制文件没有外部依赖。

如果要对 Hugo 的源代码或文档做出贡献,你应该将 Hugo 的 GitHub 项目分叉并克隆到你的本地机器上。

最后,你可以用 go 安装 Hugo 源码,自己构建二进制文件,然后用这种方式运行 Hugo。构建二进制文件对于一个有经验的 goer 来说是一件很简单的事情。

安装Hugo作为您的站点生成器(二进制安装)

使用 Hugo 文档中的 安装说明

从源代码构建并安装二进制文件(高级安装)

先决工具

从 GitHub 获取

从 Hugo 0.48 开始,Hugo 使用 Go 1.11 中内置的 Go Modules 支持来构建。最简单的是将 Hugo 克隆到 GOPATH 以外的目录中,就像下面的例子:

mkdir $HOME/src
cd $HOME/src
git clone https://github.com/gohugoio/hugo.git
cd hugo
go install

如果你是 Windows 用户,请用 %USERPROFILE% 代替上面的 $HOME 环境变量。

如果你想用 Sass/SCSS 支持编译,使用 -tags extended,并确保在你的 go 环境中设置 CGO_ENABLED=1。如果你不想启用 CGO,你可以使用下面的命令暂时只为 hugo 编译启用 CGO:

CGO_ENABLED=1 go install --tags extended

Hugo 文档

Hugo 文档现在在自己的仓库里,见 https://github.com/gohugoio/hugoDocs。但我们确实在这个版本库中保留了一个 git 子树的文档版本。要建立子文件夹 /docs 作为 Hugo 站点,你需要克隆这个仓库。

git clone git@github.com:gohugoio/hugo.git

对 Hugo 的贡献

关于如何为雨果做出贡献的完整指南,请参见贡献指南

我们欢迎对 Hugo 做出任何形式的贡献,包括文档、主题、组织、教程、博客文章、bug 报告、问题、功能请求、功能实现、pull 请求、在论坛上回答问题、帮助管理问题等。

Hugo 社区和维护者是非常活跃和乐于助人的,项目从这些活动中受益匪浅。

提出支持问题

我们有一个活跃的 论坛,用户和开发人员可以在这里提出问题。请不要使用 GitHub 问题跟踪器来提问。

报告问题

如果你认为你在 Hugo 或其文档中发现了缺陷,请使用 GitHub 问题跟踪器向 Hugo 维护者报告问题。如果你不确定这是不是一个 bug,可以从讨论区开始询问。报告问题时,请提供正在使用的雨果版本(hugo版本)。

提交补丁

雨果项目欢迎所有的贡献者和贡献者,无论技能或经验水平如何。如果你有兴趣帮助这个项目,我们将帮助你完成你的贡献。雨果是一个非常活跃的项目,每天都有很多贡献发生。

我们希望为我们的用户创造最好的产品,为我们的开发者提供最好的贡献体验,我们有一套准则来确保所有的贡献都是可接受的。这些指导原则并不打算作为参与的过滤器或障碍。如果您对贡献过程不熟悉,雨果团队将帮助您,并教您如何按照指导原则进行贡献。

依赖性

Hugo 站在许多伟大的开源库的肩膀上,按词义顺序排列。

(恕删略。请参见自述文件)

(vz Revised on 2020.12.20)

Overview

Name With Ownergohugoio/hugo
Primary LanguageGo
Program languageGo (Language Count: 6)
PlatformBSD, Docker, Linux, Windows, Android
License:Apache License 2.0
Release Count261
Last Release Namev0.124.1 (Posted on )
First Release Namev0.7 (Posted on )
Created At2013-07-04 15:26:26
Pushed At2024-03-24 08:47:17
Last Commit At2024-03-22 15:56:10
Stargazers Count72k
Watchers Count1.1k
Fork Count7.3k
Commits Count8.2k
Has Issues Enabled
Issues Count7086
Issue Open Count445
Pull Requests Count2383
Pull Requests Open Count46
Pull Requests Close Count2605
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

A Fast and Flexible Static Site Generator built with love by bep, spf13 and friends in Go.

Website |
Forum |
Documentation |
Installation Guide |
Contribution Guide |
Twitter

GoDoc
Linux and macOS Build Status
Go Report Card

Overview

Hugo is a static HTML and CSS website generator written in Go.
It is optimized for speed, ease of use, and configurability.
Hugo takes a directory with content and templates and renders them into a full HTML website.

Hugo relies on Markdown files with front matter for metadata, and you can run Hugo from any directory.
This works well for shared hosts and other systems where you don’t have a privileged account.

Hugo renders a typical website of moderate size in a fraction of a second.
A good rule of thumb is that each piece of content renders in around 1 millisecond.

Hugo is designed to work well for any kind of website including blogs, tumbles, and docs.

Supported Architectures

Currently, we provide pre-built Hugo binaries for Windows, Linux, FreeBSD, NetBSD, DragonFly BSD, Open BSD, macOS (Darwin), and Android for x64, i386 and ARM architectures.

Hugo may also be compiled from source wherever the Go compiler tool chain can run, e.g. for other operating systems including Plan 9 and Solaris.

Complete documentation is available at Hugo Documentation.

Choose How to Install

If you want to use Hugo as your site generator, simply install the Hugo binaries.
The Hugo binaries have no external dependencies.

To contribute to the Hugo source code or documentation, you should fork the Hugo GitHub project and clone it to your local machine.

Finally, you can install the Hugo source code with go, build the binaries yourself, and run Hugo that way.
Building the binaries is an easy task for an experienced go getter.

Install Hugo as Your Site Generator (Binary Install)

Use the installation instructions in the Hugo documentation.

Build and Install the Binaries from Source (Advanced Install)

Prerequisite Tools

Fetch from GitHub

Since Hugo 0.48, Hugo uses the Go Modules support built into Go 1.11 to build. The easiest is to clone Hugo in a directory outside of GOPATH, as in the following example:

mkdir $HOME/src
cd $HOME/src
git clone https://github.com/gohugoio/hugo.git
cd hugo
go install

If you are a Windows user, substitute the $HOME environment variable above with %USERPROFILE%.

If you want to compile with Sass/SCSS support use --tags extended and make sure CGO_ENABLED=1 is set in your go environment. If you don't want to have CGO enabled, you may use the following command to temporarily enable CGO only for hugo compilation:

CGO_ENABLED=1 go install --tags extended

The Hugo Documentation

The Hugo documentation now lives in its own repository, see https://github.com/gohugoio/hugoDocs. But we do keep a version of that documentation as a git subtree in this repository. To build the sub folder /docs as a Hugo site, you need to clone this repo:

git clone git@github.com:gohugoio/hugo.git

Contributing to Hugo

For a complete guide to contributing to Hugo, see the Contribution Guide.

We welcome contributions to Hugo of any kind including documentation, themes,
organization, tutorials, blog posts, bug reports, issues, feature requests,
feature implementations, pull requests, answering questions on the forum,
helping to manage issues, etc.

The Hugo community and maintainers are very active and helpful, and the project benefits greatly from this activity.

Asking Support Questions

We have an active discussion forum where users and developers can ask questions.
Please don't use the GitHub issue tracker to ask questions.

Reporting Issues

If you believe you have found a defect in Hugo or its documentation, use
the GitHub issue tracker to report the problem to the Hugo maintainers.
If you're not sure if it's a bug or not, start by asking in the discussion forum.
When reporting the issue, please provide the version of Hugo in use (hugo version).

Submitting Patches

The Hugo project welcomes all contributors and contributions regardless of skill or experience level.
If you are interested in helping with the project, we will help you with your contribution.
Hugo is a very active project with many contributions happening daily.

We want to create the best possible product for our users and the best contribution experience for our developers,
we have a set of guidelines which ensure that all contributions are acceptable.
The guidelines are not intended as a filter or barrier to participation.
If you are unfamiliar with the contribution process, the Hugo team will help you and teach you how to bring your contribution in accordance with the guidelines.

For a complete guide to contributing code to Hugo, see the Contribution Guide.

Analytics

Dependencies

Hugo stands on the shoulder of many great open source libraries, in lexical order:

Dependency License
github.com/alecthomas/chroma MIT License
github.com/armon/go-radix MIT License
github.com/aws/aws-sdk-go Apache License 2.0
github.com/bep/debounce MIT License
github.com/bep/gitmap MIT License
github.com/bep/golibsass MIT License
github.com/bep/tmc MIT License
github.com/BurntSushi/locker The Unlicense
github.com/BurntSushi/toml MIT License
github.com/cpuguy83/go-md2man MIT License
github.com/danwakefield/fnmatch BSD 2-Clause "Simplified" License
github.com/disintegration/gift MIT License
github.com/dustin/go-humanize MIT License
github.com/fsnotify/fsnotify BSD 3-Clause "New" or "Revised" License
github.com/gobwas/glob MIT License
github.com/gorilla/websocket BSD 2-Clause "Simplified" License
github.com/hashicorp/golang-lru Mozilla Public License 2.0
github.com/hashicorp/hcl Mozilla Public License 2.0
github.com/jdkato/prose MIT License
github.com/kr/pretty MIT License
github.com/kyokomi/emoji MIT License
github.com/magiconair/properties BSD 2-Clause "Simplified" License
github.com/markbates/inflect MIT License
github.com/mattn/go-isatty MIT License
github.com/mattn/go-runewidth MIT License
github.com/miekg/mmark Simplified BSD License
github.com/mitchellh/hashstructure MIT License
github.com/mitchellh/mapstructure MIT License
github.com/muesli/smartcrop MIT License
github.com/nicksnyder/go-i18n MIT License
github.com/niklasfasching/go-org MIT License
github.com/olekukonko/tablewriter MIT License
github.com/pelletier/go-toml MIT License
github.com/pkg/errors BSD 2-Clause "Simplified" License
github.com/PuerkitoBio/purell BSD 3-Clause "New" or "Revised" License
github.com/PuerkitoBio/urlesc BSD 3-Clause "New" or "Revised" License
github.com/rogpeppe/go-internal BSD 3-Clause "New" or "Revised" License
github.com/russross/blackfriday Simplified BSD License
github.com/rwcarlsen/goexif BSD 2-Clause "Simplified" License
github.com/spf13/afero Apache License 2.0
github.com/spf13/cast MIT License
github.com/spf13/cobra Apache License 2.0
github.com/spf13/fsync MIT License
github.com/spf13/jwalterweatherman MIT License
github.com/spf13/pflag BSD 3-Clause "New" or "Revised" License
github.com/spf13/viper MIT License
github.com/tdewolff/minify MIT License
github.com/tdewolff/parse MIT License
github.com/yuin/goldmark MIT License
github.com/yuin/goldmark-highlighting MIT License
go.opencensus.io Apache License 2.0
go.uber.org/atomic MIT License
gocloud.dev Apache License 2.0
golang.org/x/image BSD 3-Clause "New" or "Revised" License
golang.org/x/net BSD 3-Clause "New" or "Revised" License
golang.org/x/oauth2 BSD 3-Clause "New" or "Revised" License
golang.org/x/sync BSD 3-Clause "New" or "Revised" License
golang.org/x/sys BSD 3-Clause "New" or "Revised" License
golang.org/x/text BSD 3-Clause "New" or "Revised" License
golang.org/x/xerrors BSD 3-Clause "New" or "Revised" License
google.golang.org/api BSD 3-Clause "New" or "Revised" License
google.golang.org/genproto Apache License 2.0
gopkg.in/ini.v1 Apache License 2.0
gopkg.in/yaml.v2 Apache License 2.0
To the top