Skip to content

Commit 1975504

Browse files
authored
support news (#3)
1 parent 1ca90ab commit 1975504

File tree

18 files changed

+179
-6
lines changed

18 files changed

+179
-6
lines changed

archetypes/news.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: "{{ replace .Name "-" " " | title }}"
3+
description: ""
4+
lead: ""
5+
date: {{ .Date }}
6+
lastmod: {{ .Date }}
7+
draft: true
8+
weight: 50
9+
images: ["{{ .Name | urlize }}.jpg"]
10+
contributors: []
11+
---

archetypes/news/_index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "News"
3+
description: ""
4+
lead: ""
5+
date: 2022-01-25T14:40:56+01:00
6+
lastmod: 2022-01-25T14:40:56+01:00
7+
draft: false
8+
images: []
9+
type: news
10+
---

archetypes/news/lorem/_index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "Lorem"
3+
description: ""
4+
lead: ""
5+
date: 2022-01-25T14:41:21+01:00
6+
lastmod: 2022-01-25T14:41:21+01:00
7+
draft: false
8+
images: []
9+
type: news
10+
---

archetypes/news/lorem/ipsum/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: "Ipsum"
3+
description: ""
4+
lead: ""
5+
date: 2022-01-25T14:41:39+01:00
6+
lastmod: 2022-01-25T14:41:39+01:00
7+
draft: false
8+
images: []
9+
type: news
10+
menu:
11+
{{ .Section }}:
12+
parent: "lorem"
13+
weight: 100
14+
toc: true
15+
---

archetypes/released.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: "{{ replace .Name "-" " " | title }}"
3+
description: ""
4+
lead: ""
5+
date: {{ .Date }}
6+
lastmod: {{ .Date }}
7+
draft: true
8+
images: []
9+
menu:
10+
docs:
11+
parent: ""
12+
weight: 999
13+
toc: true
14+
---

archetypes/released/_index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "Released"
3+
description: ""
4+
lead: ""
5+
date: 2022-01-25T14:40:56+01:00
6+
lastmod: 2022-01-25T14:40:56+01:00
7+
draft: false
8+
images: []
9+
type: released
10+
---

archetypes/released/lorem/_index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "Lorem"
3+
description: ""
4+
lead: ""
5+
date: 2022-01-25T14:41:21+01:00
6+
lastmod: 2022-01-25T14:41:21+01:00
7+
draft: false
8+
images: []
9+
type: released
10+
---
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: "Ipsum"
3+
description: ""
4+
lead: ""
5+
date: 2022-01-25T14:41:39+01:00
6+
lastmod: 2022-01-25T14:41:39+01:00
7+
draft: false
8+
images: []
9+
type: released
10+
menu:
11+
{{ .Section }}:
12+
parent: "lorem"
13+
weight: 100
14+
toc: true
15+
---

config/_default/menus/menus.en.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[[docs]]
88
name = "Help"
9-
weight = 60
9+
weight = 20
1010
identifier = "help"
1111
url = "/docs/help/"
1212

@@ -16,8 +16,8 @@
1616
weight = 10
1717

1818
[[main]]
19-
name = "Blog"
20-
url = "/blog/"
19+
name = "News"
20+
url = "/news/"
2121
weight = 20
2222

2323
[[social]]

config/_default/menus/menus.zh.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[[docs]]
88
name = "Help"
9-
weight = 60
9+
weight = 20
1010
identifier = "help"
1111
url = "/docs/help/"
1212

@@ -16,8 +16,8 @@
1616
weight = 10
1717

1818
[[main]]
19-
name = "Blog"
20-
url = "/blog/"
19+
name = "News"
20+
url = "/news/"
2121
weight = 20
2222

2323
[[social]]

content/en/news/_index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: "News"
3+
description: "The OpeninGO News."
4+
date: 2020-10-06T08:49:55+00:00
5+
lastmod: 2020-10-06T08:49:55+00:00
6+
draft: false
7+
images: []
8+
---

content/en/news/weclome/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: "Welcome👋"
3+
description: "Introducing OpeninGO"
4+
lead: "Introducing OpeninGO"
5+
date: 2020-11-04T09:19:42+01:00
6+
lastmod: 2020-11-04T09:19:42+01:00
7+
draft: false
8+
weight: 50
9+
images: ["opening-web-logo.svg"]
10+
contributors: ["qicz"]
11+
---

content/en/news/weclome/opening-web-logo.svg

Lines changed: 1 addition & 0 deletions
Loading

content/zh/news/_index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: "News"
3+
description: "The OpeninGO News."
4+
date: 2020-10-06T08:49:55+00:00
5+
lastmod: 2020-10-06T08:49:55+00:00
6+
draft: false
7+
images: []
8+
---

content/zh/news/weclome/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: "Welcome👋"
3+
description: "Introducing OpeninGO"
4+
lead: "Introducing OpeninGO"
5+
date: 2020-11-04T09:19:42+01:00
6+
lastmod: 2020-11-04T09:19:42+01:00
7+
draft: false
8+
weight: 50
9+
images: ["opening-web-logo.svg"]
10+
contributors: ["qicz"]
11+
---

content/zh/news/weclome/opening-web-logo.svg

Lines changed: 1 addition & 0 deletions
Loading

layouts/news/list.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{ define "main" }}
2+
<div class="row justify-content-center">
3+
<div class="col-md-12 col-lg-10 col-xl-8">
4+
<article>
5+
<h1 class="text-center">{{ .Title }}</h1>
6+
<div class="text-center">{{ .Content }}</div>
7+
<div class="card-list">
8+
{{ $paginator := .Paginate (.Data.Pages) -}}
9+
{{ range $paginator.Pages -}}
10+
<div class="card">
11+
<div class="card-body">
12+
<h2 class="h3"><a class="stretched-link text-body" href="{{ .RelPermalink }}">{{ .Params.title }}</a></h2>
13+
<p>{{ .Params.lead | safeHTML }}</p>
14+
{{ partial "main/blog-meta.html" . -}}
15+
</div>
16+
</div>
17+
{{ end -}}
18+
{{ $.Scratch.Set "paginator" true }}
19+
{{ template "_internal/pagination.html" . }}
20+
</div>
21+
</article>
22+
</div>
23+
</div>
24+
{{ end }}

layouts/news/single.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{ define "main" }}
2+
<div class="row justify-content-center">
3+
<div class="col-md-12 col-lg-10 col-xl-8">
4+
<article>
5+
<div class="blog-header">
6+
<h1>{{ .Title }}</h1>
7+
{{ partial "main/blog-meta.html" . }}
8+
</div>
9+
<p class="lead">{{ .Params.lead | safeHTML }}</p>
10+
{{ .Content }}
11+
</article>
12+
</div>
13+
</div>
14+
{{ end }}

0 commit comments

Comments
 (0)