Skip to content

Commit

Permalink
docs: update install from scratch
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Dec 5, 2023
1 parent fda5e3f commit 4a7e595
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
18 changes: 17 additions & 1 deletion exampleSite/content/docs/install-from-scratch/index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ authors:

We offers an example site for getting started with this theme.

{{< bs/alert danger >}}
{{< markdownify >}}
Please run these commands from [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows) or a Linux terminal such as WSL or Git Bash.
{{< /markdownify >}}
{{< /bs/alert >}}

## Requirements

- Go
Expand Down Expand Up @@ -62,9 +68,15 @@ cd mysite

## Tweak `go.mod`

{{< bs/alert >}}
{{< markdownify >}}
This guide uses `sed` command to edit the file, please feel free to open and edit the `go.mod` with your favorite editor.
{{< /markdownify >}}
{{< /bs/alert >}}

### Replace Module Path

The module path is the identifier of your site, which typically is your repo URL, take `github.com/user/repo` as an example.
The module path is the identifier of your site, which typically is your repo URL, take `github.com/user/repo` as an example, you'll need to replace the `module github.com/hbstack/theme-cards/exampleSite` with `module github.com/user/repo`.

```sh
sed -i '1s/.*/module github.com\/user\/repo/' go.mod
Expand All @@ -84,6 +96,10 @@ sed -i '/^replace/d' go.mod
npm ci
```

## Hugo Module Proxy (Optional)

A [Hugo module proxy](https://hugomods.com/blog/2023/04/go-and-hugo-proxy-servers/) is required when the default proxy isn't accessible from your location, i.e. China.

## Preview Locally

```sh
Expand Down
18 changes: 17 additions & 1 deletion exampleSite/content/docs/install-from-scratch/index.zh-hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ authors:

我们提供了一个示例站点以方便你快速入门该主题。

{{< bs/alert danger >}}
{{< markdownify >}}
请于 [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows) 或者 Linux 终端运行以下命令,如 WSL 或 Git Bash。
{{< /markdownify >}}
{{< /bs/alert >}}

## 环境要求

- Go
Expand Down Expand Up @@ -62,9 +68,15 @@ cd mysite

## 调整 `go.mod`

{{< bs/alert >}}
{{< markdownify >}}
本文利用 `sed` 命令进行文件编辑,请随意使用你喜欢的编辑器打开和修改 `go.mod`
{{< /markdownify >}}
{{< /bs/alert >}}

### 替换模块路径

模块路径是站点的标识,其一般为仓库 URL,这里以 `github.com/user/repo` 为例。
模块路径是站点的标识,其一般为仓库 URL,这里以 `github.com/user/repo` 为例,则需要将 `module github.com/hbstack/theme-cards/exampleSite` 替换为 `module github.com/user/repo`

```sh
sed -i '1s/.*/module github.com\/user\/repo/' go.mod
Expand All @@ -84,6 +96,10 @@ sed -i '/^replace/d' go.mod
npm ci
```

## Hugo 模块代理(可选)

当你的所在地区(比如国内)无法访问默认的代理时,则需要设置[Hugo 模块代理](https://hugomods.com/blog/2023/04/go-and-hugo-proxy-servers/)

## 本地预览

```sh
Expand Down

0 comments on commit 4a7e595

Please sign in to comment.