Skip to content

Commit

Permalink
Config Decap CMS
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Nov 25, 2023
1 parent 4ec5a2c commit c652897
Show file tree
Hide file tree
Showing 22 changed files with 1,275 additions and 38 deletions.
1 change: 1 addition & 0 deletions config/_default/hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ outputs:
- RSS
- SearchIndex
- WebAppManifest
- DecapCMSConfig

taxonomies:
authors: authors
Expand Down
25 changes: 25 additions & 0 deletions config/_default/params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,28 @@ hugopress:
disabled: true
hb-header-docsearch:
disabled: true

decap_cms:
publish_mode: editorial_workflow
collections:
sites:
editor:
preview: false
identifier_field: name
summary: "{{title}} - {{domain}}"
format: toml
label: Sites
label_singular: Site
description: HB Framework showcases.
name: sites
create: true
folder: "data/sites"
slug: "{{fields.domain}}"
fields:
- {label: Title, name: title, widget: string}
- {label: Domain, name: domain, widget: string}
- {label: Date, name: date, widget: datetime, date_format: "YYYY-MM-DD", time_format: false}
- {label: Pinned, name: pinned, widget: "hidden", default: false}
- {label: Logo, name: logo, widget: string, required: false, hint: "Logo URL."}
- {label: Logo width, name: logo_width, widget: number, required: false, value_type: int, hint: "Logo intrinsic width, required when logo is set."}
- {label: Logo height, name: logo_height, widget: number, required: false, value_type: int, hint: "Logo intrinsic height, required when logo is set."}
5 changes: 5 additions & 0 deletions config/development/params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ hugopress:
# hb:
# anti_adblock:
# remind_interval: 0.0025 # 9s

decap_cms:
backend:
name: git-gateway
local_backend: true
6 changes: 6 additions & 0 deletions config/production/params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ google_adsense: ca-pub-7827859788508375

microsoft_clarity:
id: jqynhnhhg9

decap_cms:
backend:
name: github
repo: hbstack/site
open_authoring: true
4 changes: 4 additions & 0 deletions content/admin/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Content Manager System
layout: decap-cms
---
12 changes: 3 additions & 9 deletions content/sites/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ Create a data file with following format to describe your site under the [/data/

{{< bs/alert warning >}}
{{< markdownify >}}
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`.
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`.
{{< /markdownify >}}
{{< /bs/alert >}}

```toml
url = "https://example.org/"
domain = "example.org"
title = "Site title"
date = "2023-xx-xx"
# logo = ""
Expand All @@ -50,19 +50,13 @@ date = "2023-xx-xx"

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

{{< bs/alert warning >}}
{{< markdownify >}}
The URLs **MUST** begin with HTTPS protocol, otherwise we won't accept your site.
{{< /markdownify >}}
{{< /bs/alert >}}

## Sites Using HB Framework {.text-center .mt-5}

{{< sites >}}
12 changes: 3 additions & 9 deletions content/sites/index.zh-hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ menu:

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

```toml
url = "https://example.org/"
domain = "example.org"
title = "站点名称"
date = "2023-xx-xx"
# logo = ""
Expand All @@ -50,19 +50,13 @@ date = "2023-xx-xx"

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

{{< bs/alert warning >}}
{{< markdownify >}}
URLs **必须**使用 HTTPS 协议,否则我们不会接受你的站点。
{{< /markdownify >}}
{{< /bs/alert >}}

## 正在使用 HB 框架的站点 { .text-center .mt-5 }

{{< sites >}}
12 changes: 3 additions & 9 deletions content/sites/index.zh-hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ menu:

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

```toml
url = "https://example.org/"
domain = "example.org"
title = "站點名稱"
date = "2023-xx-xx"
# logo = ""
Expand All @@ -50,19 +50,13 @@ date = "2023-xx-xx"

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

{{< bs/alert warning >}}
{{< markdownify >}}
URLs **必須**使用 HTTPS 協議,否則我們不會接受你的站點。
{{< /markdownify >}}
{{< /bs/alert >}}

## 正在使用 HB 框架的站點 { .text-center .mt-5 }

{{< sites >}}
2 changes: 1 addition & 1 deletion data/sites/evanote-mew-kr.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url = "https://evanote.mew.kr/"
domain = "evanote.mew.kr"
title = "EvaNOTE"
date = "2023-09-19"
logo = "https://evanote.mew.kr/favicon-150x150.png"
Expand Down
2 changes: 1 addition & 1 deletion data/sites/hbstack-dev.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url = "https://hbstack.dev/"
domain = "hbstack.dev"
title = "HB Framework"
logo = "https://avatars.githubusercontent.com/u/127904984?s=200&v=4"
logo_width = 200
Expand Down
2 changes: 1 addition & 1 deletion data/sites/hugomods-com.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url = "https://hugomods.com/"
domain = "hugomods.com"
title = "Hugo Modules"
logo = "https://avatars.githubusercontent.com/u/128204519?s=200&v=4"
logo_width = 200
Expand Down
2 changes: 1 addition & 1 deletion data/sites/insights-ditatompel-com.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url = "https://insights.ditatompel.com/"
domain = "insights.ditatompel.com"
title = "insights.ditatompel.com"
date = "2023-11-07"
logo = "https://edge.ditatompel.com/assets/img/favicon/ditatompel/512x512.png"
Expand Down
2 changes: 1 addition & 1 deletion data/sites/learn-software.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url = "https://learn-software.com/"
domain = "learn-software.com"
title = "Learn-Software.com"
date = "2023-11-02"
logo = "https://learn-software.com/images/logo.png"
Expand Down
2 changes: 1 addition & 1 deletion data/sites/razonyang-com.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
url = "https://razonyang.com/"
domain = "razonyang.com"
title = "Razon Yang"
date = "2023-09-03"
2 changes: 1 addition & 1 deletion data/sites/squey-org.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url = "https://squey.org/"
domain = "squey.org"
title = "Squey"
date = "2023-09-04"
logo = "https://squey.org/favicon-150x150.png"
Expand Down
2 changes: 1 addition & 1 deletion data/sites/start-razonyang-com.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url = "https://start.razonyang.com/"
domain = "start.razonyang.com"
title = "Start Page"
logo = "https://start.razonyang.com/images/logo_hu9af9bd4823f304ca6e1e19912844ac3b_25603_0x64_resize_q75_box.jpg"
logo_width = 64
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ require (
github.com/hugomods/base v0.4.0 // indirect
github.com/hugomods/bootstrap v0.14.0 // indirect
github.com/hugomods/code-block-panel v0.5.0 // indirect
github.com/hugomods/decap-cms v0.3.0 // indirect
github.com/hugomods/docsearch v0.1.0 // indirect
github.com/hugomods/font-awesome v6.4.2+incompatible // indirect
github.com/hugomods/fuse-js v0.1.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ github.com/hugomods/bootstrap v0.14.0 h1:G/TnHqH5UVjUJDkLGxmxAPInjCWtAFGt+R76a8T
github.com/hugomods/bootstrap v0.14.0/go.mod h1:xibujTCci1NMBmQ8jzvxAYx2bKKQVWaoaZYNcnx6tGQ=
github.com/hugomods/code-block-panel v0.5.0 h1:IjlVQZJccs02x0TaNxsLR4S2PRyzy3tBXE3nFT2vJxA=
github.com/hugomods/code-block-panel v0.5.0/go.mod h1:3J9yUxaShbhYvFFZbGVHcBoHPl6TUKLL3f2fTsnVNNg=
github.com/hugomods/decap-cms v0.3.0 h1:TXv9VVQLxXTuWy50KtK8nFzEVCjGNNqsQV6GR+4hcyE=
github.com/hugomods/decap-cms v0.3.0/go.mod h1:P9gUtk59PZYBCNVIqiovRPqI13WiKkutMtJl2YQLkMA=
github.com/hugomods/docsearch v0.1.0 h1:c4H/DaCG+o3TGG3mt3l5WKh9lTFHIudZG+QzzGpZ534=
github.com/hugomods/docsearch v0.1.0/go.mod h1:vevXNQ1mFdKq7tt6owqcg+Y2BB3slumVKINV0SwgyCs=
github.com/hugomods/font-awesome v6.4.2+incompatible h1:oTdZYvNEXRuocAaGTa8f6ZET9e+cjD8JXpZRG7dx8Qw=
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/sites.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{{- range $sites }}
<a
class="hb-site text-decoration-none mb-4 mx-3 d-flex align-items-center justify-content-center text-center text-uppercase{{ cond (not .logo) ` border rounded p-2 text-bg-secondary` `` }}"
href="{{ .url }}"
href="https://{{ .domain }}"
target="_blank"
rel="external"
title="{{ .title }}">
Expand Down
1 change: 1 addition & 0 deletions modules/common/hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module:
private: github.com/hbstack/anti-adblock
imports:
- path: github.com/hugomods/decap-cms
- path: github.com/hbstack/google-fonts
- path: github.com/hbstack/header/themes/pills
- path: github.com/hbstack/header/modules/news
Expand Down
Loading

0 comments on commit c652897

Please sign in to comment.