mirror of
https://github.com/imfing/hextra.git
synced 2025-05-13 19:06:24 -04:00
2.3 KiB
2.3 KiB
title | weight | next | prev |
---|---|---|---|
快速开始 | 1 | /docs/guide | /docs |
使用模板快速开始
{{< icon "github" >}} imfing/hextra-starter-template
通过使用上面的模板仓库,您将能够快速地开始。

我们提供了一个 GitHub Actions 工作流,它可以帮助您自动构建并部署您的网站到 GitHub Pages,并免费托管。
作为新项目开始
前提条件
在开始之前,请确保我们已经安装了 Hugo。 请参考 Hugo 的官方安装指南以获取更多详情。
Hugo 模块是管理 Hugo 主题的推荐方式。要使用 Hugo 模块,我们需要安装 Git 和 Go。
{{% steps %}}
初始化 Hugo 站点
$ hugo new site my-site --format=yaml
通过模块配置 Hextra 主题
# 初始化 Hugo 模块
$ cd my-site
$ hugo mod init github.com/username/my-site
# 添加 Hextra
$ hugo mod get github.com/imfing/hextra
编辑 hugo.yaml
以启用 Hextra:
module:
imports:
- path: github.com/imfing/hextra
创建你的第一个内容页
让我们为主页和文档页面创建一个新的内容页面:
$ hugo new content/_index.md
$ hugo new content/docs/_index.md
在本地预览站点
$ hugo server --buildDrafts --disableFastRender
瞧!你现在可以在 http://localhost:1313/
看到你的新站点。
{{% /steps %}}
接下来
你可以探索以下部分来添加更多内容:
{{< cards >}} {{< card link="../guide/organize-files" title="目录结构" icon="document-duplicate" >}} {{< card link="../guide/configuration" title="配置文件指南" icon="adjustments" >}} {{< card link="../guide/markdown" title="Markdown" icon="markdown" >}} {{< /cards >}}