Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ When the `perPagePosts` is set to `2`, this plugin will help you generate the fo
| `/2018/06/08/c/` | `Post` |

::: tip
`DirectoryPagination / Layout` means that the layout component will Will be downgraded to `Layout` when `DirectoryPagination` layout doesn't exist.
`DirectoryPagination / Layout` means that the layout component will be downgraded to `Layout` when `DirectoryPagination` layout doesn't exist.
:::

So how to get the matched pages in the layout component? In fact, it will be much simpler than you think.

If you visit `/`, current page leverages layout `IndexPost`, in this layout component, you just need to use `this
.$pagination.pages` to get the matched pages, in the above example, the actual value of `this.$pagination.pages` will
If you visit `/`, current page leverages layout `IndexPost`. In this layout component, you just need to use
`this.$pagination.pages` to get the matched pages. In the above example, the actual value of `this.$pagination.pages` will
be:

```json
Expand All @@ -200,20 +200,20 @@ If you visit `/`, current page leverages layout `IndexPost`, in this layout comp
]
```

If you visit `/`, current page leverages layout `DirectoryPagination`, you can also use `this
.$pagination.pages` to access it:
If you visit `/`, current page leverages layout `DirectoryPagination`, you can also use
`this.$pagination.pages` to access it:

```json
[
{ "relativePath": "_posts/2019-6-8-c.md", "path": "/2019/06/08/c/" ... },
]
```

Isn't a very natural experiences? You just need to care about the style of your layout component, not the complicated and boring logic behind it.
Isn't this very natural experience? You just need to care about the style of your layout component, not the complicated and boring logic behind it.


::: tip
To save the length of docs, we omitted the data structure of `$page` object. you can get more information about
To save the length of docs, we omitted the data structure of the `$page` object. You can get more information about
the data structure of `$page` at the [official documentation](https://v1.vuepress.vuejs.org/guide/global-computed.html#page).
:::

Expand Down Expand Up @@ -265,22 +265,22 @@ module.exports = {
// Layout of the `entry page`
layout: 'Tag',
},
]
]
}]
]
}
```

Then the plugin will help you to generate following extra pages, and automatically leverage corresponding
layout:
Then the plugin will help you to generate the following extra pages, and automatically leverage
the corresponding layout:

| url | layout |
|---|---|
| `/tag/` | `Tag` |
| `/tag/vue/` | `FrontmatterPagination` / `Layout` |
| `/tag/js/` | `FrontmatterPagination` / `Layout` |

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

```json
[
Expand Down Expand Up @@ -325,7 +325,7 @@ classification:

## Examples

Actually, there are only 2 necessary layouts components to create a blog theme:
Actually, there are only 2 necessary layout components to create a blog theme:

- Layout
- Post
Expand Down