Skip to content

Commit

Permalink
Docs: 更新部署步骤文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Nov 26, 2024
1 parent 42f93d0 commit 5e3bfaa
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 85 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ resources/

.hugo_build.lock
_vendor

.hugo_build.lock
jsconfig.json
18 changes: 14 additions & 4 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ For a complete quick start, see this [page](https://fixit.lruihao.cn/documentati
git clone --recursive https://github.com/<your_name>/<your_blog_repo>.git
```

> [!TIP]
> The repository name determines your GitHub Pages URL, for example:
>
> | Repository Name | GitHub Pages |
> | :--- | :--- |
> | `<your_name>.github.io` | `https://<your_name>.github.io/` |
> | `blog` | `https://<your_name>.github.io/blog/` |

### Launching the Site

```bash
Expand All @@ -63,11 +71,13 @@ hugo

### Deploy to GitHub Pages

1. Head to Setting => Actions => General => Workflow permissions => Check "Read and write permissions".
2. Manually run Workflow: Actions => Hugo build and deploy => Click Run workflow button.
3. GitHub Pages settings: Setting => Pages => Source: Deploy from a branch => Branch: `gh-pages` => Save.
> [!NOTE]
> You may have noticed that the first automatic deployment of GitHub Actions after the template initialization failed. This is because you have not configured Workflow permissions and GitHub Pages.

> Only need to manually run the Workflow the first time you deploy, and it will be automatically deployed every time you push to the `main` branch.
1. Head to Setting => Actions => General => Workflow permissions => Check "Read and write permissions".
2. GitHub Pages settings: Setting => Pages => Source: GitHub Actions.
3. Modify `config/_default/hugo.toml` file `baseURL` to your site URL.
4. Commit the changes from the previous step to the `main` branch, and GitHub Actions will automatically build and deploy the site to GitHub Pages.

### Update Theme

Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
git clone --recursive https://github.com/<your_name>/<your_blog_repo>.git
```

> [!TIP]
> 仓库名决定了你的 GitHub Pages URL,例如:
>
> | 仓库名 | GitHub Pages |
> | :--- | :--- |
> | `<your_name>.github.io` | `https://<your_name>.github.io/` |
> | `blog` | `https://<your_name>.github.io/blog/` |

### 启动站点

```bash
Expand All @@ -63,11 +71,13 @@ hugo

### 部署到 GitHub Pages

1. 转到 Setting => Actions => General => Workflow permissions => 选中 "Read and write permissions"
2. 手动运行 Workflow: Actions => Hugo build and deploy => 点击 Run workflow 按钮。
3. GitHub Pages 设置:Setting => Pages => Source: Deploy from a branch => Branch: `gh-pages` => Save。
> [!NOTE]
> 聪明的你可能已经注意到,模板初始化后的第一次 GitHub Actions 自动部署失败了。这是因为你还没有配置 Workflow 权限和 GitHub Pages。

> 只有第一次部署时需要手动运行 Workflow,之后每次推送到 `main` 分支都会自动部署。
1. 转到 Setting => Actions => General => Workflow permissions => 选中 "Read and write permissions"
2. GitHub Pages 设置:Setting => Pages => Source: GitHub Actions。
3. 修改 `config/_default/hugo.toml` 文件中的 `baseURL` 为你的站点 URL。
4. 提交上一步的修改到 `main` 分支,GitHub Actions 将自动打包并部署站点到 GitHub Pages。

### 更新主题

Expand Down
2 changes: 1 addition & 1 deletion assets/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"baseUrl": ".",
"paths": {
"*": [
"../../../../Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/hugo-fixit/!fix!it@v0.3.14/assets/*"
"../../../../hugo_cache/modules/filecache/modules/pkg/mod/github.com/hugo-fixit/!fix!it@v0.3.15/assets/*"
]
}
}
Expand Down
75 changes: 2 additions & 73 deletions content/posts/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,83 +13,12 @@ Welcome to Hugo FixIt! This is your very first post.

<!--more-->

## Documentation

Head to the documentation page linked below for a complete guidence to get started with the [FixIt](https://github.com/hugo-fixit/FixIt) theme.

{{< fixit-docs-bookmark >}}

## Quick Start

For a complete quick start, see this [page](https://fixit.lruihao.cn/documentation/getting-started/).

### Prerequisites

- [Go](https://go.dev/dl/)
- [Hugo](https://gohugo.io/installation/) (extended version)

### Use this Template

1. Click [**Use this template**](https://github.com/hugo-fixit/hugo-fixit-starter/generate), and create your repository on GitHub.

<img width="913" alt="image" src="https://github.com/hugo-fixit/hugo-fixit-starter1/assets/33419593/d5fbd940-3ffd-4750-b1e6-4e87b50b0696">

2. Once the repository is created, just clone and enjoy it!

```bash
# Clone with your own repository url
git clone --recursive https://github.com/<your_name>/<your_blog_repo>.git
```

### Launching the Site

```bash
# Development environment
hugo server
# Production environment
hugo server -e production
```

### Build the Site

When your site is ready to deploy, run the following command:

```bash
hugo
```

### Deploy to GitHub Pages

1. Head to Setting => Actions => General => Workflow permissions => Check "Read and write permissions".
2. Manually run Workflow: Actions => Hugo build and deploy => Click Run workflow button.
3. GitHub Pages settings: Setting => Pages => Source: Deploy from a branch => Branch: `gh-pages` => Save.

> Only need to manually run the Workflow the first time you deploy, and it will be automatically deployed every time you push to the `main` branch.

### Update Theme

Afterwards you can upgrade the theme with the following command:

```bash
# Update theme manually
hugo mod get -u github.com/hugo-fixit/FixIt@latest
hugo mod tidy
```

<details>
<summary>Start via NPM script</summary>

```bash
# build the blog
npm run build
# run a local debugging server with watch
npm run server
# run a local debugging server in production environment
npm run server:production
# update theme submodules
npm run update:theme
```

</details>

## Feedback

Whether it's questions, ideas, bugs or pull requests, all feedback is welcome!
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ go 1.19

require (
github.com/hugo-fixit/FixIt v0.3.15 // indirect
github.com/hugo-fixit/shortcode-docs-bookmark v1.0.2 // indirect
github.com/hugo-fixit/shortcode-docs-bookmark v1.0.3 // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/hugo-fixit/FixIt v0.3.15 h1:t/3aip2sl7OR8mtgutKv4ME9d/Ktmfmh4ZIadSMmwYI=
github.com/hugo-fixit/FixIt v0.3.15/go.mod h1:3XIRedrqakO7/a4ZnhE46haMRF8HgsT0N0B5j5D2iRU=
github.com/hugo-fixit/shortcode-docs-bookmark v1.0.2 h1:VIcMt3SWSZYFyz0d+SfKb7ad3ZrQ2i87KJTYRfVTEfk=
github.com/hugo-fixit/shortcode-docs-bookmark v1.0.2/go.mod h1:suLPTLy/z2dvpHMEn9TFE+AxwyuTzmmD87vEiW078wI=
github.com/hugo-fixit/shortcode-docs-bookmark v1.0.3 h1:OMkbLv4yIifZ/dNUNoIvFhCxOFQNUAAbRkgqe+9aycQ=
github.com/hugo-fixit/shortcode-docs-bookmark v1.0.3/go.mod h1:suLPTLy/z2dvpHMEn9TFE+AxwyuTzmmD87vEiW078wI=

0 comments on commit 5e3bfaa

Please sign in to comment.