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

Commit 16d318d

Browse files
feat: integrate with feed (#58)
1 parent 458caeb commit 16d318d

16 files changed

+116
-1
lines changed

docs/config/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,4 +249,18 @@ It will be enabled when `endpoint` is provided. e.g.
249249
```
250250
[vuepress-plugin-mailchimp](https://vuepress-plugin-mailchimp.billyyyyy3320.com/) is how we implement the feature. This config will be pass directly to it, so please head [vuepress-plugin-mailchimp](https://vuepress-plugin-mailchimp.billyyyyy3320.com/#config) for more details.
251251

252+
## feed
252253

254+
- Type: `object`
255+
- Default: `{}`
256+
- Required: `false`
257+
258+
It will be enabled when `canonical_base` is provided. e.g.
259+
260+
```js
261+
{
262+
canonical_base: 'https://yoursite'
263+
}
264+
```
265+
266+
All the generated files will be placed under your output directory. If you wish to make further configuration, please check out [vuepress-plugin-feed](https://github.com/webmasterish/vuepress-plugin-feed).

docs/guide/getting-started.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,29 @@ In your theme, You'll probably offer users options whether to enable or not. You
460460

461461
Please head [UI-customization](https://vuepress-plugin-mailchimp.billyyyyy3320.com/#ui-customization) if you don't like the default UI.
462462

463+
## Feed
464+
465+
Feed is another approach to allow your users to get your latest content. RSS, Atom, and even JSON feeds are the right tools for the job. Let's see an example:
466+
467+
```JavaScript
468+
// .vuepress/config.js
469+
module.exports = {
470+
plugins: [
471+
[
472+
'@vuepress/blog',
473+
{
474+
feed: {
475+
canonical_base: 'http://yoursite',
476+
},
477+
},
478+
],
479+
],
480+
}
481+
```
482+
483+
After building, you'll be able to find them (`rss.xml`, `feed.atom`, `feed.json`) in you output directory (`dist`).
484+
485+
463486
## Examples
464487

465488
There're some [examples](https://github.com/vuepressjs/vuepress-plugin-blog/tree/master/examples) under this project help us test this plugin. They're also simplest examples for you after reading all the concept above.

examples/sitemap/.vuepress/config.js renamed to examples/sitemap+feed/.vuepress/config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ module.exports = {
2626
sitemap: {
2727
hostname: 'https://yourdomain'
2828
},
29+
feed:{
30+
canonical_base: 'http://localhost:8080',
31+
}
2932
}],
3033
],
3134
}

0 commit comments

Comments
 (0)