Skip to content

Commit c652897

Browse files
committed
Config Decap CMS
1 parent 4ec5a2c commit c652897

22 files changed

Lines changed: 1275 additions & 38 deletions

config/_default/hugo.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ outputs:
1818
- RSS
1919
- SearchIndex
2020
- WebAppManifest
21+
- DecapCMSConfig
2122

2223
taxonomies:
2324
authors: authors

config/_default/params.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,28 @@ hugopress:
156156
disabled: true
157157
hb-header-docsearch:
158158
disabled: true
159+
160+
decap_cms:
161+
publish_mode: editorial_workflow
162+
collections:
163+
sites:
164+
editor:
165+
preview: false
166+
identifier_field: name
167+
summary: "{{title}} - {{domain}}"
168+
format: toml
169+
label: Sites
170+
label_singular: Site
171+
description: HB Framework showcases.
172+
name: sites
173+
create: true
174+
folder: "data/sites"
175+
slug: "{{fields.domain}}"
176+
fields:
177+
- {label: Title, name: title, widget: string}
178+
- {label: Domain, name: domain, widget: string}
179+
- {label: Date, name: date, widget: datetime, date_format: "YYYY-MM-DD", time_format: false}
180+
- {label: Pinned, name: pinned, widget: "hidden", default: false}
181+
- {label: Logo, name: logo, widget: string, required: false, hint: "Logo URL."}
182+
- {label: Logo width, name: logo_width, widget: number, required: false, value_type: int, hint: "Logo intrinsic width, required when logo is set."}
183+
- {label: Logo height, name: logo_height, widget: number, required: false, value_type: int, hint: "Logo intrinsic height, required when logo is set."}

config/development/params.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ hugopress:
1818
# hb:
1919
# anti_adblock:
2020
# remind_interval: 0.0025 # 9s
21+
22+
decap_cms:
23+
backend:
24+
name: git-gateway
25+
local_backend: true

config/production/params.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,9 @@ google_adsense: ca-pub-7827859788508375
22

33
microsoft_clarity:
44
id: jqynhnhhg9
5+
6+
decap_cms:
7+
backend:
8+
name: github
9+
repo: hbstack/site
10+
open_authoring: true

content/admin/_index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Content Manager System
3+
layout: decap-cms
4+
---

content/sites/index.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ Create a data file with following format to describe your site under the [/data/
3535

3636
{{< bs/alert warning >}}
3737
{{< markdownify >}}
38-
The data file naming convention: use the domain name and replace the dot (`.`) with the dash (`-`), for example, `https://example.org/` should saved as `example-org.toml`.
38+
The data file naming convention: use the domain name and replace the dot (`.`) with the dash (`-`), for example, `example.org` should saved as `example-org.toml`.
3939
{{< /markdownify >}}
4040
{{< /bs/alert >}}
4141

4242
```toml
43-
url = "https://example.org/"
43+
domain = "example.org"
4444
title = "Site title"
4545
date = "2023-xx-xx"
4646
# logo = ""
@@ -50,19 +50,13 @@ date = "2023-xx-xx"
5050

5151
| Property | Type | Description |
5252
| -------- | :--: | ----------- |
53-
| `url` | string | Site URL, **required**. |
53+
| `domain` | string | Site domain, **required**. |
5454
| `title` | string | Site title, **required**, please take as short as possible, otherwise it'll be truncated. |
5555
| `date` | date | The date you're requesting to add the site, such as `2023-09-01`, **required**. |
5656
| `logo` | string | Site logo, optional. |
5757
| `logo_width` | number | Logo intrinsic width, required when `logo` is set. |
5858
| `logo_height` | number | Logo intrinsic height, required when `logo` is set. |
5959

60-
{{< bs/alert warning >}}
61-
{{< markdownify >}}
62-
The URLs **MUST** begin with HTTPS protocol, otherwise we won't accept your site.
63-
{{< /markdownify >}}
64-
{{< /bs/alert >}}
65-
6660
## Sites Using HB Framework {.text-center .mt-5}
6761

6862
{{< sites >}}

content/sites/index.zh-hans.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ menu:
3535

3636
{{< bs/alert warning >}}
3737
{{< markdownify >}}
38-
数据文件命名约定:使用域名并将其中的点(`.`)替换为破折号(`-`),比如 `https://example.org/` 应该保存为 `example-org.toml`
38+
数据文件命名约定:使用域名并将其中的点(`.`)替换为破折号(`-`),比如 `example.org` 应该保存为 `example-org.toml`
3939
{{< /markdownify >}}
4040
{{< /bs/alert >}}
4141

4242
```toml
43-
url = "https://example.org/"
43+
domain = "example.org"
4444
title = "站点名称"
4545
date = "2023-xx-xx"
4646
# logo = ""
@@ -50,19 +50,13 @@ date = "2023-xx-xx"
5050

5151
| Property | Type | Description |
5252
| -------- | :--: | ----------- |
53-
| `url` | string | 网站 URL**必填**|
53+
| `domain` | string | 网站域名**必填**|
5454
| `title` | string | 网站名称,请尽可能短,否则可能会被截断。 |
5555
| `date` | date | 请求添加你的站点时的日期,如 `2023-09-01`**必填**|
5656
| `logo` | string | 网站 logo,可选。|
5757
| `logo_width` | number | Logo 原始宽度,当设置了 `logo` 时则必填。 |
5858
| `logo_height` | number | Logo 原始高度,当设置了 `logo` 时则必填。 |
5959

60-
{{< bs/alert warning >}}
61-
{{< markdownify >}}
62-
URLs **必须**使用 HTTPS 协议,否则我们不会接受你的站点。
63-
{{< /markdownify >}}
64-
{{< /bs/alert >}}
65-
6660
## 正在使用 HB 框架的站点 { .text-center .mt-5 }
6761

6862
{{< sites >}}

content/sites/index.zh-hant.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ menu:
3535

3636
{{< bs/alert warning >}}
3737
{{< markdownify >}}
38-
數據文件命名約定:使用域名並將其中的點(`.`)替換爲破折號(`-`),比如 `https://example.org/` 應該保存爲 `example-org.toml`
38+
數據文件命名約定:使用域名並將其中的點(`.`)替換爲破折號(`-`),比如 `example.org` 應該保存爲 `example-org.toml`
3939
{{< /markdownify >}}
4040
{{< /bs/alert >}}
4141

4242
```toml
43-
url = "https://example.org/"
43+
domain = "example.org"
4444
title = "站點名稱"
4545
date = "2023-xx-xx"
4646
# logo = ""
@@ -50,19 +50,13 @@ date = "2023-xx-xx"
5050

5151
| Property | Type | Description |
5252
| -------- | :--: | ----------- |
53-
| `url` | string | 網站 URL**必填**|
53+
| `domain` | string | 網站域名**必填**|
5454
| `title` | string | 網站名稱,請儘可能短,否則可能會被截斷。 |
5555
| `date` | date | 請求添加你的站點時的日期,如 `2023-09-01`**必填**|
5656
| `logo` | string | 網站 logo,可選。|
5757
| `logo_width` | number | Logo 原始寬度,當設置了 `logo` 時則必填。 |
5858
| `logo_height` | number | Logo 原始高度,當設置了 `logo` 時則必填。 |
5959

60-
{{< bs/alert warning >}}
61-
{{< markdownify >}}
62-
URLs **必須**使用 HTTPS 協議,否則我們不會接受你的站點。
63-
{{< /markdownify >}}
64-
{{< /bs/alert >}}
65-
6660
## 正在使用 HB 框架的站點 { .text-center .mt-5 }
6761

6862
{{< sites >}}

data/sites/evanote-mew-kr.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
url = "https://evanote.mew.kr/"
1+
domain = "evanote.mew.kr"
22
title = "EvaNOTE"
33
date = "2023-09-19"
44
logo = "https://evanote.mew.kr/favicon-150x150.png"

data/sites/hbstack-dev.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
url = "https://hbstack.dev/"
1+
domain = "hbstack.dev"
22
title = "HB Framework"
33
logo = "https://avatars.githubusercontent.com/u/127904984?s=200&v=4"
44
logo_width = 200

0 commit comments

Comments
 (0)