Skip to content

Commit 7b170c0

Browse files
authored
Update Dockerfile
1 parent 3caa2bb commit 7b170c0

1 file changed

Lines changed: 2 additions & 42 deletions

File tree

Dockerfile

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -21,50 +21,10 @@ RUN case ${TARGETARCH} in \
2121
# 验证 Hugo 可执行
2222
RUN hugo version
2323

24-
# 创建空白站点
25-
RUN hugo new site /build --force
24+
# 克隆官方 starter 模板(已包含主题和示例内容)
25+
RUN git clone --depth 1 --recurse-submodules https://github.com/hugo-fixit/hugo-fixit-starter.git /build
2626
WORKDIR /build
2727

28-
# 克隆 FixIt 主题(使用稳定版本 v0.4.5)
29-
RUN git clone --depth 1 --branch v0.4.5 https://github.com/hugo-fixit/FixIt.git themes/FixIt
30-
31-
# 生成配置文件
32-
RUN cat > config.toml <<EOF
33-
baseURL = "https://example.org/"
34-
title = "My FixIt Site"
35-
theme = "FixIt"
36-
defaultContentLanguage = "zh-cn"
37-
enableRobotsTXT = true
38-
paginate = 10
39-
40-
[markup]
41-
_merge = "shallow"
42-
43-
[outputs]
44-
_merge = "shallow"
45-
46-
[taxonomies]
47-
_merge = "shallow"
48-
49-
[params]
50-
version = "4.x"
51-
description = "A site built with Hugo FixIt theme"
52-
keywords = ["Hugo", "FixIt", "Blog"]
53-
defaultTheme = "auto"
54-
EOF
55-
56-
# 创建首页(必须)
57-
RUN cat > content/_index.md <<EOF
58-
---
59-
title: "Home"
60-
---
61-
Welcome to my FixIt site.
62-
EOF
63-
64-
# 创建一篇示例文章
65-
RUN mkdir -p content/posts && \
66-
printf '%s\n' '---' 'title: "Welcome to FixIt Docker"' "date: $(date +%Y-%m-%d)" 'draft: false' '---' '' 'This is a default post. You can replace it by mounting your own content.' > content/posts/welcome.md
67-
6828
# 构建静态文件
6929
RUN hugo --minify --destination /public
7030

0 commit comments

Comments
 (0)