Skip to content

Commit ec646de

Browse files
committed
支持归档、搜索、友链功能
1 parent 2b448ff commit ec646de

File tree

5 files changed

+64
-26
lines changed

5 files changed

+64
-26
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
public
22
resources
3-
.hugo_build.lock
3+
.hugo_build.lock
4+
.DS_Store

content/page/archives/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: "归档"
3+
date: 1998-06-16
4+
layout: "archives"
5+
slug: "archives"
6+
menu:
7+
main:
8+
weight: -70
9+
params:
10+
icon: archives
11+
---

content/page/links/index.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: 友链
3+
links:
4+
- title: GitHub
5+
description: GitHub is the world's largest software development platform.
6+
website: https://github.com
7+
image: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
8+
- title: TypeScript
9+
description: TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.
10+
website: https://www.typescriptlang.org
11+
image: ts-logo-128.jpg
12+
menu:
13+
main:
14+
weight: -50
15+
params:
16+
icon: link
17+
18+
comments: false
19+
---
20+
21+
To use this feature, add `links` section to frontmatter.
22+
23+
This page's frontmatter:
24+
25+
```yaml
26+
links:
27+
- title: GitHub
28+
description: GitHub is the world's largest software development platform.
29+
website: https://github.com
30+
image: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
31+
- title: TypeScript
32+
description: TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.
33+
website: https://www.typescriptlang.org
34+
image: ts-logo-128.jpg
35+
```
36+
37+
`image` field accepts both local and external images.

content/page/search/index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: "搜索"
3+
slug: "search"
4+
layout: "search"
5+
outputs:
6+
- html
7+
- json
8+
menu:
9+
main:
10+
weight: -60
11+
params:
12+
icon: search
13+
---

hugo.toml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -146,35 +146,11 @@ enabled = true
146146
[[menu.main]]
147147
name = "主页"
148148
url = "/"
149-
weight = 10
149+
weight = -90
150150
identifier = "home"
151151
[menu.main.params]
152152
icon = "home"
153153
newTab = false
154-
[[menu.main]]
155-
name = "归档"
156-
url = "/archives/"
157-
weight = 20
158-
identifier = "archives"
159-
[menu.main.params]
160-
icon = "archives"
161-
newTab = false
162-
[[menu.main]]
163-
name = "搜索"
164-
url = "/search/"
165-
weight = 30
166-
identifier = "search"
167-
[menu.main.params]
168-
icon = "search"
169-
newTab = false
170-
[[menu.main]]
171-
name = "友链"
172-
url = "/links/"
173-
weight = 40
174-
identifier = "links"
175-
[menu.main.params]
176-
icon = "link"
177-
newTab = false
178154

179155
[[menu.social]]
180156
identifier = "github"

0 commit comments

Comments
 (0)