Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
: 🐛 merge module config has side effects
Browse files Browse the repository at this point in the history
pls modify config:
```toml
[module]
# comment or delete next line
# _merge = 'deep'
[[module.mounts]]
  source = 'assets'
  target = 'assets'
[[module.mounts]]
  source = "hugo_stats.json"
  target = "assets/watching/hugo_stats.json"
```
  • Loading branch information
canstand committed Aug 28, 2023
1 parent 7490a77 commit fe30107
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 69 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,28 @@ Compost is a simple, lightweight theme for [Hugo](https://gohugo.io). Mainly bas
1. Set the theme in the Hugo project as `github.com/canstand/compost`, and add required options to `hugo.toml`:

```toml
theme = 'github.com/canstand/compost'

# required
[build]
_merge = 'deep'
_merge = 'deep'

# required
[markup]
_merge = 'deep'
_merge = 'deep'

# for better seo
[minify]
_merge = 'deep'
_merge = 'deep'

# required
[module]
_merge = 'deep'
[[module.mounts]]
source = 'assets'
target = 'assets'
[[module.mounts]]
source = "hugo_stats.json"
target = "assets/watching/hugo_stats.json"
[[module.imports]]
path="github.com/canstand/compost"
path="github.com/canstand/compost"
```

2. Install or upgrade dependencies:
Expand Down
17 changes: 10 additions & 7 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,28 @@ Compost 是一个简单、轻量级的 [Hugo](https://gohugo.io) 主题。主要
1. 在 Hugo 项目配置文件 `hugo.toml` 里指定主题为 `github.com/canstand/compost`,并且配置需要从主题合并的默认选项:

```toml
theme = 'github.com/canstand/compost'

# required
[build]
_merge = 'deep'
_merge = 'deep'

# required
[markup]
_merge = 'deep'
_merge = 'deep'

# for better seo
[minify]
_merge = 'deep'
_merge = 'deep'

# required
[module]
_merge = 'deep'
[[module.mounts]]
source = 'assets'
target = 'assets'
[[module.mounts]]
source = "hugo_stats.json"
target = "assets/watching/hugo_stats.json"
[[module.imports]]
path="github.com/canstand/compost"
path="github.com/canstand/compost"
```

2. 安装或升级依赖:
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/canstand/compost/exampleSite

go 1.19
go 1.20

require (
github.com/canstand/compost v0.6.0 // indirect
Expand Down
13 changes: 9 additions & 4 deletions exampleSite/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,23 @@ paginate = 5

# required
[build]
_merge = 'deep'
_merge = 'deep'

# required
[markup]
_merge = 'deep'
_merge = 'deep'

# for better seo
[minify]
_merge = 'deep'
_merge = 'deep'

[module]
_merge = 'deep'
[[module.mounts]]
source = 'assets'
target = 'assets'
[[module.mounts]]
source = "hugo_stats.json"
target = "assets/watching/hugo_stats.json"

[languages]
[languages.en]
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/canstand/compost

go 1.19
go 1.20
78 changes: 41 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.hugo.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
}
},
"dependencies": {
"@alpinejs/intersect": "^3.12.3",
"alpinejs": "^3.12.3"
"@alpinejs/intersect": "^3.13.0",
"alpinejs": "^3.13.0"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.27",
"autoprefixer": "^10.4.15",
"postcss": "^8.4.28",
"postcss-cli": "^10.1.0",
"prettier": "^3.0.0",
"prettier": "^3.0.2",
"prettier-plugin-go-template": "^0.0.15",
"tailwindcss": "^3.3.3"
},
Expand All @@ -40,5 +40,5 @@
"scripts": {
"prettier": "npx prettier --write ."
},
"version": "0.6.0"
"version": "0.6.1"
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
}
},
"dependencies": {
"@alpinejs/intersect": "^3.12.3",
"alpinejs": "^3.12.3"
"@alpinejs/intersect": "^3.13.0",
"alpinejs": "^3.13.0"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.27",
"autoprefixer": "^10.4.15",
"postcss": "^8.4.28",
"postcss-cli": "^10.1.0",
"prettier": "^3.0.0",
"prettier": "^3.0.2",
"prettier-plugin-go-template": "^0.0.15",
"tailwindcss": "^3.3.3"
},
Expand All @@ -40,5 +40,5 @@
"scripts": {
"prettier": "npx prettier --write ."
},
"version": "0.6.0"
"version": "0.6.1"
}

0 comments on commit fe30107

Please sign in to comment.