Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit c842c86

Browse files
authored
docs: update
1 parent eb95533 commit c842c86

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

docs/README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ layout:
8181

8282
| url | layout |
8383
|---|---|
84-
| `/` | `IndexPost` |
84+
| `/` | `IndexPost` / `Layout` |
8585
| `/2018/04/04/intro-to-vuepress/` | `Post` |
8686
| `/2019/06/08/intro-to-vuepress-next/` | `Post` |
8787

@@ -174,12 +174,16 @@ When the `perPagePosts` is set to `2`, this plugin will help you generate the fo
174174

175175
| url | layout |
176176
|---|---|
177-
| `/` | `IndexPost / Layout` |
178-
| `/page/2/` (New) | `DirectoryPagination / Layout` |
177+
| `/` | `IndexPost` / `Layout` |
178+
| `/page/2/` (New) | `DirectoryPagination` / `Layout` |
179179
| `/2019/06/08/a/` | `Post` |
180180
| `/2019/06/08/b/` | `Post` |
181181
| `/2018/06/08/c/` | `Post` |
182182

183+
::: tip
184+
`DirectoryPagination / Layout` means that the layout component will Will be downgraded to `Layout` when `DirectoryPagination` layout doesn't exist.
185+
:::
186+
183187
So how to get the matched pages in the layout component? In fact, it will be much simpler than you think.
184188

185189
If you visit `/`, current page leverages layout `IndexPost`, in this layout component, you just need to use `this
@@ -270,8 +274,8 @@ layout:
270274
| url | layout |
271275
|---|---|
272276
| `/tag/` | `Tag` |
273-
| `/tag/vue/` | `FrontmatterClassifier` |
274-
| `/tag/js/` | `FrontmatterClassifier` |
277+
| `/tag/vue/` | `FrontmatterPagination` / `Layout` |
278+
| `/tag/js/` | `FrontmatterPagination` / `Layout` |
275279

276280
In `Tags` component, you can use `this.$tag.list` to get the tag list. the value would be like:
277281

@@ -295,9 +299,8 @@ In `Tags` component, you can use `this.$tag.list` to get the tag list. the value
295299
]
296300
```
297301

298-
In `FrontmatterClassifier` component, you can use `this.$pagination.pages` to get the matched pages in current tag
299-
classification. And what is wonderful is that a you don't nned to card about where you are, and you'll get a very
300-
natural experiences:
302+
In the `FrontmatterPagination` component, you can use `this.$pagination.pages` to get the matched pages in current tag
303+
classification:
301304

302305
- If you visit `/tag/vue/`, the `this.$pagination.pages` will be:
303306

@@ -319,8 +322,13 @@ natural experiences:
319322

320323
## Examples
321324

322-
Here is [live example](https://github.com/ulivz/70-lines-of-vuepress-blog-theme) that implements a VuePress theme in around 70 lines.
325+
Actually, there are only 2 necessary layouts components to create a blog theme:
326+
327+
- Layout
328+
- Post
329+
- Tag (Only required when you set up a `tag` frontmatter classification.)
323330

331+
Here is [live example](https://github.com/ulivz/70-lines-of-vuepress-blog-theme) that implements a functionally qualified VuePress theme in around 70 lines.
324332

325333
## Options
326334

0 commit comments

Comments
 (0)