Update the Hugo

Update the old version of hugo and update the blog.

语速

Since the previously used Hugo version was too low and updating it would require significant effort, I have now updated Hugo, allowing me to focus solely on writing articles.

The new theme I am currently using is hugo-theme-stack.

Because my Hugo source files and <username>.github.io are not in the same repository—meaning I cannot directly configure gh-pages using a branch—I have adjusted the workflow to suit my situation. Here is my workflow configuration file:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

name: Deploy to Github Pages

on:
    push:
        branches: [master]
    pull_request:
        branches: [master]

jobs:
    build:
        runs-on: ubuntu-latest

        permissions:
            # Give the default GITHUB_TOKEN write permission to commit and push the
            # added or changed files to the repository.
            contents: write

        steps:
            - uses: actions/checkout@v4
              with:
                  fetch-depth: 0

            - name: Cache Hugo resources
              uses: actions/cache@v4
              env:
                  cache-name: cache-hugo-resources
              with:
                  path: resources
                  key: ${{ env.cache-name }}

            - uses: actions/setup-go@v5
              with:
                  go-version: "^1.17.0"
            - run: go version

            - name: Setup Hugo
              uses: peaceiris/actions-hugo@v2
              with:
                  hugo-version: "latest"
                  extended: true

            - name: Build
              run: hugo --minify --gc

            - name: Deploy
              uses: peaceiris/actions-gh-pages@v3
              with:
                personal_token: ${{ secrets.
ACCESS_TOKEN }}
                external_repository: svtter/svtter.github.io
                publish_branch: master
                publish_dir: ./public