Skip to content

Commit fa1104e

Browse files
committed
更新归档文章功能说明
1 parent fe30d65 commit fa1104e

File tree

2 files changed

+63
-37
lines changed

2 files changed

+63
-37
lines changed

docs/en/guide/README.md

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ lazyload:
167167

168168
`loading_img`: The placeholder image when loading
169169

170-
`onlypost`: If true, only enable lazyload on the post page. For custom pages, you can set `lazyload: true` in [Front-matter](https://hexo.io/zh-cn/docs/front-matter)
170+
`onlypost`: If true, only enable lazyload on the post page. For custom pages, you can set `lazyload: true` in [front-matter](https://hexo.io/zh-cn/docs/front-matter)
171171

172172
`offset_factor`: The factor of viewport height that triggers loading
173173

@@ -305,7 +305,7 @@ open_graph:
305305
fb_app_id:
306306
```
307307

308-
In addition, you can set fields in [Front-matter](https://hexo.io/docs/front-matter) to specify the OpenGraph property of a single page:
308+
In addition, you can set fields in [front-matter](https://hexo.io/docs/front-matter) to specify the OpenGraph property of a single page:
309309

310310
```yaml
311311
---
@@ -402,7 +402,7 @@ Part of the content as an excerpt
402402
The rest of the text
403403
```
404404

405-
Or you can set `excerpt` in [Front-matter](https://hexo.io/docs/front-matter):
405+
Or you can set `excerpt` in [front-matter](https://hexo.io/docs/front-matter):
406406

407407
```yaml
408408
---
@@ -447,7 +447,7 @@ index:
447447

448448
### Hide Posts
449449

450-
If you want to hide some posts on the index page, you can set `hide: true` at the [Front-matter](https://hexo.io/docs/front-matter) of the post.
450+
If you want to hide some posts, you can set `hide: true` at the [front-matter](https://hexo.io/docs/front-matter) of the post.
451451

452452
```yaml
453453
---
@@ -459,14 +459,26 @@ hide: true
459459
This is post content
460460
```
461461

462-
:::tip
463-
Hiding makes the post invisible in both category page and tag page.
464-
You can still enter post link.
465-
:::
462+
`hide` makes the post invisible on all pages.
463+
But you can still enter post link.
464+
465+
### Archive Posts
466+
467+
If you want to makes the post invisible on index pages, you can set `archive: true` at the [front-matter](https://hexo.io/docs/front-matter) of the post.
468+
469+
```yaml
470+
---
471+
title: post title
472+
index_img: /img/example.jpg
473+
date: 2019-10-10 10:00:00
474+
archive: true
475+
---
476+
This is post content
477+
```
466478

467479
### Sort Posts
468480

469-
If you want to sort posts on the index page, you can set `sticky` at the [Front-matter](https://hexo.io/docs/front-matter) of the post, the premise is `hexo-generator-index` >= 2.0.0.
481+
If you want to sort posts on the index page, you can set `sticky` at the [front-matter](https://hexo.io/docs/front-matter) of the post, the premise is `hexo-generator-index` >= 2.0.0.
470482

471483
```yaml
472484
---
@@ -495,7 +507,7 @@ index:
495507

496508
### Index Image
497509

498-
You can define it at [Front-matter](https://hexo.io/docs/front-matter) of a post.
510+
You can define it at [front-matter](https://hexo.io/docs/front-matter) of a post.
499511

500512
```yaml
501513
---
@@ -522,7 +534,7 @@ When `default_index_img` and `index_img` are empty, no image will be displayed o
522534

523535
### Banner Image
524536

525-
The default display of `post.banner_img` in **theme config**, you can set `banner_img` via [Front-matter](https://hexo.io/zh-cn/docs/front-matter) to set it separately:
537+
The default display of `post.banner_img` in **theme config**, you can set `banner_img` via [front-matter](https://hexo.io/zh-cn/docs/front-matter) to set it separately:
526538

527539
```yaml
528540
---
@@ -641,7 +653,7 @@ If you want to import a new comment plugin, you can add `<script>` through [Cust
641653
If your comment area is not displayed, there may be throwing some errors, you can find out the reason in the console of your browser.
642654
:::
643655

644-
If you want to disable comment plugin on a post page, or want to enable comments on a custom page, you can set `comment: false` or `comment: 'type'` into [Front-matter](https://hexo.io/zh-cn/docs/front-matter).
656+
If you want to disable comment plugin on a post page, or want to enable comments on a custom page, you can set `comment: false` or `comment: 'type'` into [front-matter](https://hexo.io/zh-cn/docs/front-matter).
645657

646658
For example, enable comment plugin on the about page:
647659

@@ -822,7 +834,7 @@ post:
822834
engine: mathjax
823835
```
824836
825-
if `specific`: true,you should add `math: true` into [Front-matter](https://hexo.io/docs/front-matter) , and then the typesetting will be display on post page, and it can improve the speed of page load.
837+
if `specific`: true,you should add `math: true` into [front-matter](https://hexo.io/docs/front-matter) , and then the typesetting will be display on post page, and it can improve the speed of page load.
826838

827839
`engine`: engine for typesetting, `mathjax` or `katex` is supported.
828840

@@ -865,7 +877,7 @@ $$
865877
:::warning
866878
- You can't install more than one renderer, and can't install plugins such as `hexo-math` or `hexo-katex`.
867879
- If your typesetting can't display correctly, you can check the below steps.
868-
- The custom page doesn't load math by default, you need to specify `math: true` into [Front-matter](https://hexo.io/docs/front-matter) to ues it.
880+
- The custom page doesn't load math by default, you need to specify `math: true` into [front-matter](https://hexo.io/docs/front-matter) to ues it.
869881
:::
870882

871883
<InArticleAdsense :data-ad-client=$themeConfig.ads.client :data-ad-slot=$themeConfig.ads.inSlot is-new-ads-code="yes"></InArticleAdsense>
@@ -882,7 +894,7 @@ post:
882894
options:
883895
```
884896

885-
`specific`: If true, only set `mermaid: true` into Front-matter will enable mermaid, to load faster when the page does not contain mermaid
897+
`specific`: If true, only set `mermaid: true` into front-matter will enable mermaid, to load faster when the page does not contain mermaid
886898

887899
`options`: API options, see [mermaidAPI.js](http://mermaid-js.github.io/mermaid/#/mermaidAPI)
888900

@@ -1003,7 +1015,7 @@ about:
10031015

10041016
### Comment
10051017

1006-
Enable comment plugin via the [Front-matter](https://hexo.io/zh-cn/docs/front-matter) set `comment: bool` to enable the comment plugin, or set `comment: 'type'`to enable the specified comment plugin.
1018+
Enable comment plugin via the [front-matter](https://hexo.io/zh-cn/docs/front-matter) set `comment: bool` to enable the comment plugin, or set `comment: 'type'`to enable the specified comment plugin.
10071019

10081020
```yaml
10091021
---
@@ -1087,7 +1099,7 @@ page:
10871099
banner_mask_alpha: 0.3
10881100
```
10891101

1090-
Also set it in [Front-matter](https://hexo.io/zh-cn/docs/front-matter):
1102+
Also set it in [front-matter](https://hexo.io/zh-cn/docs/front-matter):
10911103

10921104
```yaml
10931105
---
@@ -1102,7 +1114,7 @@ Markdown or HTML
11021114

11031115
### Comment
11041116

1105-
Enable comment plugin in the same way as the about page, via the [Front-matter](https://hexo.io/zh-cn/docs/front-matter), set `comment: bool` to enable the comment plugin, or set `comment: 'type'`to enable the specified comment plugin.
1117+
Enable comment plugin in the same way as the about page, via the [front-matter](https://hexo.io/zh-cn/docs/front-matter), set `comment: bool` to enable the comment plugin, or set `comment: 'type'`to enable the specified comment plugin.
11061118

11071119
```yaml
11081120
---

docs/guide/README.md

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ lazyload:
185185

186186
`loading_img`: 指定加载时的占位图片
187187

188-
`onlypost`: 为 true 时,懒加载仅在文章页生效,如果自定义页面需要使用,可以在 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 里指定 `lazyload: true`
188+
`onlypost`: 为 true 时,懒加载仅在文章页生效,如果自定义页面需要使用,可以在 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 里指定 `lazyload: true`
189189

190190
`offset_factor`: 触发加载的偏移倍数,基数是视窗高度(即提前 N 屏高度触发加载),可根据部署环境的请求速度调节
191191

@@ -380,7 +380,7 @@ open_graph:
380380
fb_app_id:
381381
```
382382

383-
另外你可以在 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 设置字段来指定单个页面的 OpenGraph 属性:
383+
另外你可以在 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 设置字段来指定单个页面的 OpenGraph 属性:
384384

385385
```yaml
386386
---
@@ -481,7 +481,7 @@ index:
481481
余下的正文
482482
```
483483

484-
或者在 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 里设置 `excerpt` 字段,如:
484+
或者在 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 里设置 `excerpt` 字段,如:
485485

486486
```yaml
487487
---
@@ -528,7 +528,7 @@ index:
528528

529529
### 隐藏文章
530530

531-
如果想把某些文章隐藏起来,不在首页和其他分类里展示,可以在文章开头 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 中配置 `hide: true` 属性。
531+
如果想把某些文章隐藏,**不在首页和其他归档分类页里展示**,可以在文章开头 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 中配置 `hide: true` 属性。
532532

533533
```yaml
534534
---
@@ -540,15 +540,25 @@ hide: true
540540
以下是文章内容
541541
```
542542

543-
:::tip
544-
隐藏会使文章在分类和标签类里都不显示
543+
隐藏后依然可以通过文章链接访问,所以可以用于一些需要链接跳转的特殊文章。
545544

546-
隐藏后依然可以通过文章链接访问
547-
:::
545+
### 归档文章
546+
547+
如果只是想让文章在首页隐藏,但仍**需要在归档分类页里展示**,可以在文章开头 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 中配置 `archive: true` 属性。
548+
549+
```yaml
550+
---
551+
title: 文章标题
552+
index_img: /img/example.jpg
553+
date: 2019-10-10 10:00:00
554+
archive: true
555+
---
556+
以下是文章内容
557+
```
548558

549559
### 文章排序
550560

551-
如果想手动将某些文章固定在首页靠前的位置,可以在安装 `hexo-generator-index` >= 2.0.0 版本的情况下,在文章开头 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 中配置 `sticky` 属性:
561+
如果想手动将某些文章固定在首页靠前的位置,可以在安装 `hexo-generator-index` >= 2.0.0 版本的情况下,在文章开头 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 中配置 `sticky` 属性:
552562

553563
```yaml
554564
---
@@ -577,7 +587,7 @@ index:
577587

578588
### 文章在首页的封面图
579589

580-
对于单篇文章,在文章开头 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 中配置 `index_img` 属性。
590+
对于单篇文章,在文章开头 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 中配置 `index_img` 属性。
581591

582592
```yaml
583593
---
@@ -603,7 +613,7 @@ post:
603613

604614
### 文章页顶部大图
605615

606-
默认显示**主题配置**中的 `post.banner_img`,如需要设置单个文章的 Banner,在 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 中指定 `banner_img` 属性。
616+
默认显示**主题配置**中的 `post.banner_img`,如需要设置单个文章的 Banner,在 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 中指定 `banner_img` 属性。
607617

608618
本地图片存放位置同上。
609619

@@ -724,7 +734,7 @@ disqus:
724734
如果设置后评论模块没有显示,说明配置没有完成,或者配置有误出现报错(请在浏览器控制台查看具体报错)
725735
:::
726736

727-
如果想在某个文章页关闭评论,或者想在某个自定义页面开启评论,可以通过在 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 设置 `comment: bool` 来控制评论开关,或者通过 `comment: 'type'` 来开启指定的评论插件。
737+
如果想在某个文章页关闭评论,或者想在某个自定义页面开启评论,可以通过在 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 设置 `comment: bool` 来控制评论开关,或者通过 `comment: 'type'` 来开启指定的评论插件。
728738

729739
例如在关于页开启并指定评论插件:
730740

@@ -918,7 +928,7 @@ post:
918928
engine: mathjax
919929
```
920930
921-
`specific`: 建议开启。当为 true 时,只有在文章 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 里指定 `math: true` 才会在文章页启动公式转换,以便在页面不包含公式时提高加载速度。
931+
`specific`: 建议开启。当为 true 时,只有在文章 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 里指定 `math: true` 才会在文章页启动公式转换,以便在页面不包含公式时提高加载速度。
922932

923933
`engine`: 公式引擎,目前支持 `mathjax` 或 `katex`。
924934

@@ -965,7 +975,7 @@ $$
965975
- 不可以同时安装多个渲染插件,包括 `hexo-math` 或者 `hexo-katex` 这类插件,请注意检查 `package.json`。
966976
- 如果更换公式引擎,对应渲染器也要一并更换。
967977
- 不同的渲染器,可能会导致一些 Markdown 语法不支持,或者渲染样式有细微差异。
968-
- 自定义页面默认不加载渲染,如需使用,需在 Front-matter 中指定 `math: true`
978+
- 自定义页面默认不加载渲染,如需使用,需在 front-matter 中指定 `math: true`
969979
:::
970980

971981
<InArticleAdsense :data-ad-client=$themeConfig.ads.client :data-ad-slot=$themeConfig.ads.inSlot is-new-ads-code="yes"></InArticleAdsense>
@@ -982,12 +992,12 @@ post:
982992
options:
983993
```
984994

985-
`specific`: 建议开启。当为 true 时,只有在文章 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 里指定 `mermaid: true` 才会在文章页启动流程图渲染,以便在页面不包含流程图时提高加载速度。
995+
`specific`: 建议开启。当为 true 时,只有在文章 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 里指定 `mermaid: true` 才会在文章页启动流程图渲染,以便在页面不包含流程图时提高加载速度。
986996

987997
`options`: 官方 API 的配置项,具体可见 [mermaidAPI.js](http://mermaid-js.github.io/mermaid/#/mermaidAPI)
988998

989999
:::tip
990-
自定义页面默认不加载,如需使用,需在 Front-matter 中指定 `mermaid: true`
1000+
自定义页面默认不加载,如需使用,需在 front-matter 中指定 `mermaid: true`
9911001
:::
9921002

9931003
使用 Mermaid 可以通过内置的 Tag 书写:
@@ -1124,7 +1134,7 @@ about:
11241134

11251135
### 评论
11261136

1127-
开启评论的方式是通过在 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 设置 `comment: bool` 来控制评论开关,或者通过 `comment: 'type'` 来开启指定的评论插件。
1137+
开启评论的方式是通过在 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 设置 `comment: bool` 来控制评论开关,或者通过 `comment: 'type'` 来开启指定的评论插件。
11281138

11291139
```yaml
11301140
---
@@ -1199,6 +1209,10 @@ subtitle: 若不填默认是 title
11991209
</div>
12001210
```
12011211

1212+
:::tip
1213+
如果需要和文章页相同的功能作为自定义页面,更建议按常规的文章一样在 `_posts` 中新建,然后按需使用[隐藏文章](/guide/#隐藏文章)功能,再通过链接来跳转。
1214+
:::
1215+
12021216
### 配置
12031217

12041218
页面的参数配置可以在**主题配置**中统一设置:
@@ -1210,7 +1224,7 @@ page:
12101224
banner_mask_alpha: 0.3
12111225
```
12121226

1213-
也可以直接在 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 里单独设置:
1227+
也可以直接在 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 里单独设置:
12141228

12151229
```yaml
12161230
---
@@ -1225,7 +1239,7 @@ banner_mask_alpha: 0.5
12251239

12261240
### 评论
12271241

1228-
自定义页面也可以开启评论插件,和关于页的方式相同,通过在 [Front-matter](https://hexo.io/zh-cn/docs/front-matter) 设置 `comment: bool` 来控制评论开关,或者通过 `comment: 'type'` 来开启指定的评论插件:
1242+
自定义页面也可以开启评论插件,和关于页的方式相同,通过在 [front-matter](https://hexo.io/zh-cn/docs/front-matter) 设置 `comment: bool` 来控制评论开关,或者通过 `comment: 'type'` 来开启指定的评论插件:
12291243

12301244
```yaml
12311245
---

0 commit comments

Comments
 (0)