Skip to content

Commit

Permalink
Feat: 支持统一配置 front matter 参数
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Oct 25, 2024
1 parent 7ee7c26 commit f0cfd68
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ Then, open the `hugo.toml` file and configure the `projectsAdapters` option to e
categories = []
collections = []
ignoreList = []
[params.projectsAdapters.params]
hiddenFromHomePage = true
# more font matter here ...
```

### Custom Blocks
Expand Down
3 changes: 3 additions & 0 deletions README.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ data/
categories = []
collections = []
ignoreList = []
[params.projectsAdapters.params]
hiddenFromHomePage = true
# more font matter here ...
```

### 自定义块
Expand Down
3 changes: 3 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
collections = []
# Ignore repos in the ignore list
ignoreList = []
[params.projectsAdapters.params]
hiddenFromHomePage = true
# more font matter here ...

[module]
[module.hugoVersion]
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/adapters/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
"editURL" (replace $readme.html_url "/blob/" "/edit/" )
"LinkToReport" false
-}}
{{- $groupParams := $group.params | default dict -}}
{{- $configParams := $projectsAdapters.params | default dict -}}
{{- $params = $groupParams | merge $configParams | merge $params -}}
{{- /* Post content from repo README */ -}}
{{- $markdown := $readme.content | base64Decode -}}
{{- /* Convert Hugo shortcodes to markdown plain text */ -}}
Expand Down
4 changes: 4 additions & 0 deletions projects.yml.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
- title: My developed
description: Below are some open source works I have developed.
contentAdapters: false
params:
hiddenFromHomePage: true
categories:
- foo
collections:
Expand All @@ -11,6 +13,8 @@
- title: My contributed
description: Below are some open source works I have contributed to.
contentAdapters: false
params:
hiddenFromHomePage: true
categories:
- bar
collections:
Expand Down

0 comments on commit f0cfd68

Please sign in to comment.