Skip to content

Commit 39a72a7

Browse files
committed
Added: fixit-bundle
1 parent 12d9d66 commit 39a72a7

19 files changed

Lines changed: 238 additions & 132 deletions

.gitmodules

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,42 @@
11
[submodule "themes/FixIt"]
22
path = themes/FixIt
3-
url = https://github.com/hugo-fixit/FixIt.git
4-
branch = main
3+
url = https://github.com/hugo-fixit/FixIt
54
[submodule "themes/shortcode-docs-bookmark"]
65
path = themes/shortcode-docs-bookmark
76
url = https://github.com/hugo-fixit/shortcode-docs-bookmark
7+
[submodule "themes/component-projects"]
8+
path = themes/component-projects
9+
url = https://github.com/hugo-fixit/component-projects
10+
[submodule "themes/cmpt-santa-hat"]
11+
path = themes/cmpt-santa-hat
12+
url = https://github.com/hugo-fixit/cmpt-santa-hat
13+
[submodule "themes/cmpt-translate"]
14+
path = themes/cmpt-translate
15+
url = https://github.com/hugo-fixit/cmpt-translate
16+
[submodule "themes/hugo-atom-feed"]
17+
path = themes/hugo-atom-feed
18+
url = https://github.com/hugo-fixit/hugo-atom-feed
19+
[submodule "themes/hugo-json-feed"]
20+
path = themes/hugo-json-feed
21+
url = https://github.com/hugo-fixit/hugo-json-feed
22+
[submodule "themes/shortcode-asciinema"]
23+
path = themes/shortcode-asciinema
24+
url = https://github.com/hugo-fixit/shortcode-asciinema
25+
[submodule "themes/shortcode-caniuse"]
26+
path = themes/shortcode-caniuse
27+
url = https://github.com/hugo-fixit/shortcode-caniuse
28+
[submodule "themes/shortcode-missing-translation"]
29+
path = themes/shortcode-missing-translation
30+
url = https://github.com/hugo-fixit/shortcode-missing-translation
31+
[submodule "themes/shortcode-mmt-netease"]
32+
path = themes/shortcode-mmt-netease
33+
url = https://github.com/hugo-fixit/shortcode-mmt-netease
34+
[submodule "themes/shortcode-rewards"]
35+
path = themes/shortcode-rewards
36+
url = https://github.com/hugo-fixit/shortcode-rewards
37+
[submodule "themes/cmpt-flyfish"]
38+
path = themes/cmpt-flyfish
39+
url = https://github.com/hugo-fixit/cmpt-flyfish
40+
[submodule "themes/cmpt-mdevtools"]
41+
path = themes/cmpt-mdevtools
42+
url = https://github.com/hugo-fixit/cmpt-mdevtools

README.cn.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Hugo FixIt 博客模板(Git)
2+
3+
👉 中文 | [English](README.en.md)
4+
5+
这是 Hugo 主题 [FixIt](https://github.com/hugo-fixit/FixIt) 的快速启动模板。它使用 [Git 子模块](https://git-scm.com/book/en/v2/Git-Tools-Submodules) 功能来加载主题。如果你更熟悉 Go,可以 [查看这个模板](https://github.com/hugo-fixit/hugo-fixit-starter)
6+
7+
它提供了基本的主题结构和 [配置目录](https://gohugo.io/configuration/introduction/#configuration-directory)[^1]。已经设置了 GitHub Actions,可以自动部署博客到 GitHub Pages。此外,还有一个定时任务,每天自动更新主题。
8+
9+
[^1]: 与单一站点配置文件不同,配置按环境、根配置键和语言进行拆分。
10+
11+
## 目录结构
12+
13+
```bash
14+
▸ .github/ # GitHub configuration
15+
▸ archetypes/ # page archetypes (like scaffolds of archetypes)
16+
▸ assets/ # css, js, third-party libraries etc.
17+
▸ config/ # configuration files
18+
▸ content/ # markdown files for hugo project
19+
▸ data/ # blog data (allow: yaml, json, toml), e.g. friends.yml
20+
▸ public/ # build directory
21+
▸ static/ # static files, e.g. favicon.ico
22+
▸ themes/ # theme submodules
23+
```
24+
25+
## 快速入门
26+
27+
完整的快速入门请参阅此 [页面](https://fixit.lruihao.cn/documentation/getting-started/)
28+
29+
### 准备
30+
31+
[Hugo](https://gohugo.io/installation/): >= 0.132.0 (extended version)
32+
33+
### 使用此模板
34+
35+
#### CLI
36+
37+
```bash
38+
npx fixit-cli create my-blog
39+
```
40+
41+
#### 手动
42+
43+
1. 点击 [**Use this template**](https://github.com/hugo-fixit/hugo-fixit-starter1/generate),在 GitHub 上创建你的仓库。
44+
45+
<img width="913" alt="image" src="https://github.com/hugo-fixit/hugo-fixit-starter1/assets/33419593/d5fbd940-3ffd-4750-b1e6-4e87b50b0696">
46+
47+
2. 仓库创建后,只需克隆并开始使用!
48+
49+
```bash
50+
# 使用你自己的仓库 URL 进行克隆
51+
git clone --recursive https://github.com/<your_name>/<your_blog_repo>.git
52+
```
53+
54+
> [!TIP]
55+
> 仓库名决定了你的 GitHub Pages URL,例如:
56+
>
57+
> | 仓库名 | GitHub Pages |
58+
> | :--- | :--- |
59+
> | `<your_name>.github.io` | `https://<your_name>.github.io/` |
60+
> | `blog` | `https://<your_name>.github.io/blog/` |
61+
62+
### 启动站点
63+
64+
```bash
65+
# 开发环境
66+
hugo server
67+
# 生产环境
68+
hugo server -e production
69+
```
70+
71+
### 构建站点
72+
73+
当你的站点准备部署时,运行以下命令:
74+
75+
```bash
76+
hugo
77+
```
78+
79+
### 部署到 GitHub Pages
80+
81+
> [!NOTE]
82+
> 聪明的你可能已经注意到,模板初始化后的第一次 GitHub Actions 自动部署失败了。这是因为你还没有配置 Workflow 权限和 GitHub Pages。
83+
84+
1. 转到 Setting => Actions => General => Workflow permissions => 选中 "Read and write permissions"
85+
2. GitHub Pages 设置:Setting => Pages => Source: GitHub Actions。
86+
3. 修改 `config/_default/hugo.toml` 文件中的 `baseURL` 为你的站点 URL。
87+
4. 提交上一步的修改到 `main` 分支,GitHub Actions 将自动打包并部署站点到 GitHub Pages。
88+
89+
### 更新主题
90+
91+
之后,你可以使用以下命令升级主题:
92+
93+
```bash
94+
# 手动更新主题
95+
git submodule update --remote --merge themes/FixIt
96+
```
97+
98+
<details>
99+
<summary>通过 NPM 脚本启动</summary>
100+
101+
```bash
102+
npm install
103+
# 构建博客
104+
npm run build
105+
# 运行带有监视的本地调试服务器
106+
npm run server
107+
# 在生产环境中运行本地调试服务器
108+
npm run server:production
109+
# 更新主题子模块
110+
npm run update:theme
111+
```
112+
113+
</details>
114+
115+
## 故障排除
116+
117+
<details>
118+
<summary>remote: Permission to git denied to github-actions[bot].</summary>
119+
转到 Setting => Actions => General => Workflow permissions => 选中 "Read and write permissions"
120+
</details>
121+
122+
<!-- 该项目是使用 [hugo-fixit-starter1](https://github.com/hugo-fixit/hugo-fixit-starter1) 生成的。 -->

README.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Hugo FixIt Blog Template (Git)
22

3-
👉 English | [简体中文](README.md)
3+
👉 English | [简体中文](README.cn.md)
44

55
This is a quick start template for Hugo theme [FixIt](https://github.com/hugo-fixit/FixIt). It uses [Git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) feature to load the theme. If you favor Go more, you can [check this template](https://github.com/hugo-fixit/hugo-fixit-starter).
66

README.md

Lines changed: 1 addition & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1 @@
1-
# Hugo FixIt 博客模板(Git)
2-
3-
👉 中文 | [English](README.en.md)
4-
5-
这是 Hugo 主题 [FixIt](https://github.com/hugo-fixit/FixIt) 的快速启动模板。它使用 [Git 子模块](https://git-scm.com/book/en/v2/Git-Tools-Submodules) 功能来加载主题。如果你更熟悉 Go,可以 [查看这个模板](https://github.com/hugo-fixit/hugo-fixit-starter)
6-
7-
它提供了基本的主题结构和 [配置目录](https://gohugo.io/configuration/introduction/#configuration-directory)[^1]。已经设置了 GitHub Actions,可以自动部署博客到 GitHub Pages。此外,还有一个定时任务,每天自动更新主题。
8-
9-
[^1]: 与单一站点配置文件不同,配置按环境、根配置键和语言进行拆分。
10-
11-
## 目录结构
12-
13-
```bash
14-
▸ .github/ # GitHub configuration
15-
▸ archetypes/ # page archetypes (like scaffolds of archetypes)
16-
▸ assets/ # css, js, third-party libraries etc.
17-
▸ config/ # configuration files
18-
▸ content/ # markdown files for hugo project
19-
▸ data/ # blog data (allow: yaml, json, toml), e.g. friends.yml
20-
▸ public/ # build directory
21-
▸ static/ # static files, e.g. favicon.ico
22-
▸ themes/ # theme submodules
23-
```
24-
25-
## 快速入门
26-
27-
完整的快速入门请参阅此 [页面](https://fixit.lruihao.cn/documentation/getting-started/)
28-
29-
### 准备
30-
31-
[Hugo](https://gohugo.io/installation/): >= 0.132.0 (extended version)
32-
33-
### 使用此模板
34-
35-
#### CLI
36-
37-
```bash
38-
npx fixit-cli create my-blog
39-
```
40-
41-
#### 手动
42-
43-
1. 点击 [**Use this template**](https://github.com/hugo-fixit/hugo-fixit-starter1/generate),在 GitHub 上创建你的仓库。
44-
45-
<img width="913" alt="image" src="https://github.com/hugo-fixit/hugo-fixit-starter1/assets/33419593/d5fbd940-3ffd-4750-b1e6-4e87b50b0696">
46-
47-
2. 仓库创建后,只需克隆并开始使用!
48-
49-
```bash
50-
# 使用你自己的仓库 URL 进行克隆
51-
git clone --recursive https://github.com/<your_name>/<your_blog_repo>.git
52-
```
53-
54-
> [!TIP]
55-
> 仓库名决定了你的 GitHub Pages URL,例如:
56-
>
57-
> | 仓库名 | GitHub Pages |
58-
> | :--- | :--- |
59-
> | `<your_name>.github.io` | `https://<your_name>.github.io/` |
60-
> | `blog` | `https://<your_name>.github.io/blog/` |
61-
62-
### 启动站点
63-
64-
```bash
65-
# 开发环境
66-
hugo server
67-
# 生产环境
68-
hugo server -e production
69-
```
70-
71-
### 构建站点
72-
73-
当你的站点准备部署时,运行以下命令:
74-
75-
```bash
76-
hugo
77-
```
78-
79-
### 部署到 GitHub Pages
80-
81-
> [!NOTE]
82-
> 聪明的你可能已经注意到,模板初始化后的第一次 GitHub Actions 自动部署失败了。这是因为你还没有配置 Workflow 权限和 GitHub Pages。
83-
84-
1. 转到 Setting => Actions => General => Workflow permissions => 选中 "Read and write permissions"
85-
2. GitHub Pages 设置:Setting => Pages => Source: GitHub Actions。
86-
3. 修改 `config/_default/hugo.toml` 文件中的 `baseURL` 为你的站点 URL。
87-
4. 提交上一步的修改到 `main` 分支,GitHub Actions 将自动打包并部署站点到 GitHub Pages。
88-
89-
### 更新主题
90-
91-
之后,你可以使用以下命令升级主题:
92-
93-
```bash
94-
# 手动更新主题
95-
git submodule update --remote --merge themes/FixIt
96-
```
97-
98-
<details>
99-
<summary>通过 NPM 脚本启动</summary>
100-
101-
```bash
102-
npm install
103-
# 构建博客
104-
npm run build
105-
# 运行带有监视的本地调试服务器
106-
npm run server
107-
# 在生产环境中运行本地调试服务器
108-
npm run server:production
109-
# 更新主题子模块
110-
npm run update:theme
111-
```
112-
113-
</details>
114-
115-
## 故障排除
116-
117-
<details>
118-
<summary>remote: Permission to git denied to github-actions[bot].</summary>
119-
转到 Setting => Actions => General => Workflow permissions => 选中 "Read and write permissions"
120-
</details>
121-
122-
<!-- 该项目是使用 [hugo-fixit-starter1](https://github.com/hugo-fixit/hugo-fixit-starter1) 生成的。 -->
1+
# hugo-fixit-gitmodule

config/_default/hugo.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,19 @@ enableEmoji = true
2929
# if set, the MainSections method on the Site object returns the given sections,
3030
# otherwise it returns the section with the most pages.
3131
# mainSections = ["posts"]
32+
theme = [
33+
"FixIt",
34+
"cmpt-flyfish",
35+
"cmpt-mdevtools",
36+
"cmpt-santa-hat",
37+
"cmpt-translate",
38+
"component-projects",
39+
"hugo-atom-feed",
40+
"hugo-json-feed",
41+
"shortcode-asciinema",
42+
"shortcode-caniuse",
43+
"shortcode-docs-bookmark",
44+
"shortcode-missing-translation",
45+
"shortcode-mmt-netease",
46+
"shortcode-rewards",
47+
]

package.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
{
2-
"name": "hugo-fixit-starter1",
2+
"name": "hugo-fixit-gitmodule",
33
"version": "1.0.0",
44
"description": "This is a quick start template for Hugo theme [FixIt](https://github.com/hugo-fixit/FixIt). It uses Git submodule feature to load the theme.",
5+
"private": true,
56
"main": "index.js",
67
"scripts": {
78
"build": "hugo --gc --minify --logLevel info",
8-
"server": "hugo server -D --disableFastRender --navigateToChanged --bind 0.0.0.0 -O",
9+
"server": "hugo server -D -E -F -M -N -O --disableFastRender --bind 0.0.0.0 -b http://localhost:1313 --logLevel info",
910
"server:production": "npm run server -- --environment production",
10-
"update:theme": "git submodule update --remote --merge themes/FixIt && git add themes/FixIt && git commit -m ':arrow_up: Chore(theme): update FixIt version'"
11+
"update:theme": "git submodule update --remote --merge themes/FixIt && git add themes/FixIt && git commit -m ':arrow_up: Chore(theme): update FixIt version'",
12+
"upgrade": "git submodule update --remote --merge"
1113
},
1214
"repository": {
1315
"type": "git",
14-
"url": "git+https://github.com/hugo-fixit/hugo-fixit-starter1.git"
16+
"url": "git+https://github.com/attajak/hugo-fixit-gitmodule.git"
17+
},
18+
"author": {
19+
"name": "attajak",
20+
"email": "janrak@gmail.com",
21+
"url": "https://github.com/attajak"
1522
},
16-
"author": "Lruihao (https://github.com/Lruihao)",
1723
"license": "MIT",
1824
"bugs": {
19-
"url": "https://github.com/hugo-fixit/hugo-fixit-starter1/issues"
25+
"url": "https://github.com/attajak/hugo-fixit-gitmodule/issues"
2026
},
21-
"homepage": "https://github.com/hugo-fixit/hugo-fixit-starter1#readme"
27+
"homepage": "https://github.com/attajak/hugo-fixit-gitmodule#readme"
2228
}

scripts/add_submodules.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
add_submodules() {
3+
local -r repo_path="$1"
4+
local -r sub_path="$2"
5+
6+
if [[ -z "$repo_path" || -z "$sub_path" ]]; then
7+
echo "Usage: $0 <repo_path> <sub_path>"
8+
exit 1
9+
fi
10+
11+
git submodule add "$repo_path" "$sub_path"
12+
# git add "$theme_path"
13+
# git commit -m "Add FixIt bundle as a submodule at $theme_path"
14+
}
15+
# Start of the script
16+
{
17+
# List of dependencies to include in the bundle
18+
echo "Adding submodules..."
19+
echo ""
20+
add_submodules "https://github.com/hugo-fixit/FixIt" "./themes/FixIt"
21+
add_submodules "https://github.com/hugo-fixit/component-projects" "./themes/component-projects"
22+
add_submodules "https://github.com/hugo-fixit/cmpt-flyfish" "./themes/cmpt-flyfish"
23+
add_submodules "https://github.com/hugo-fixit/cmpt-mdevtools" "./themes/cmpt-mdevtools"
24+
add_submodules "https://github.com/hugo-fixit/cmpt-santa-hat" "./themes/cmpt-santa-hat"
25+
add_submodules "https://github.com/hugo-fixit/cmpt-translate" "./themes/cmpt-translate"
26+
add_submodules "https://github.com/hugo-fixit/hugo-atom-feed" "./themes/hugo-atom-feed"
27+
add_submodules "https://github.com/hugo-fixit/hugo-json-feed" "./themes/hugo-json-feed"
28+
add_submodules "https://github.com/hugo-fixit/shortcode-asciinema" "./themes/shortcode-asciinema"
29+
add_submodules "https://github.com/hugo-fixit/shortcode-caniuse" "./themes/shortcode-caniuse"
30+
add_submodules "https://github.com/hugo-fixit/shortcode-docs-bookmark" "./themes/shortcode-docs-bookmark"
31+
add_submodules "https://github.com/hugo-fixit/shortcode-missing-translation" "./themes/shortcode-missing-translation"
32+
add_submodules "https://github.com/hugo-fixit/shortcode-mmt-netease" "./themes/shortcode-mmt-netease"
33+
add_submodules "https://github.com/hugo-fixit/shortcode-rewards" "./themes/shortcode-rewards"
34+
echo ""
35+
echo "Submodules added successfully."
36+
}

themes/cmpt-flyfish

Submodule cmpt-flyfish added at 0b50ad0

themes/cmpt-mdevtools

Submodule cmpt-mdevtools added at d390ad4

themes/cmpt-santa-hat

Submodule cmpt-santa-hat added at 3f6753c

0 commit comments

Comments
 (0)