hextra/exampleSite/content/docs/getting-started.zh-cn.md
纳兰音韵 e1a2109a68
i18n: Add some zh-cn translation of exampleSite(docs) (#12)
---------

Co-authored-by: Xin <xin@imfing.com>
2023-08-30 21:21:31 +01:00

2.2 KiB

title weight next prev
快速开始 1 /docs/guide /docs

使用模板快速开始

{{< icon "github" >}} imfing/hextra-starter-template

你可以使用此模板仓库以便于快速开始.

我们提供了一个 GitHub Actions workflow 来帮助你免费在 GitHub Pages 上自动构建和部署网站.

🌐 演示 ↗

全新开始

先决条件

在我们开始之前, 必须先确保 Hugo 已被正确安装. 转至 Hugo 的 official installation guide 以获取更多信息.

推荐使用 Hugo modules 管理 Hugo 主题. 使用 Hugo modules 需要先正确安装 GitGo.

{{% steps %}}

初始化 Hugo 站点

$ hugo new site my-site --format=yaml

通过 module 配置 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 >}}