-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugin-feed): add feed plugin (#41)
- Loading branch information
1 parent
bd72368
commit b0b2aa4
Showing
61 changed files
with
5,635 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# feed | ||
|
||
<NpmBadge package="@vuepress/plugin-feed" /> | ||
|
||
## Usage | ||
|
||
```bash | ||
npm i -D @vuepress/plugin-feed@next | ||
``` | ||
|
||
```ts title=".vuepress/config.ts" | ||
import { feedPlugin } from "@vuepress/plugin-feed"; | ||
|
||
export default { | ||
plugins: [ | ||
feedPlugin({ | ||
// options | ||
}), | ||
], | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# Channel Config | ||
|
||
The channel plugin option is used to config the feed channel. | ||
|
||
## channel.title | ||
|
||
- Type: `string` | ||
- Default: `SiteConfig.title` | ||
|
||
Channel title | ||
|
||
## channel.link | ||
|
||
- Type: `string` | ||
- Default: Deployment link (generated by `options.hostname` and `context.base`) | ||
|
||
Channel address | ||
|
||
## channel.description | ||
|
||
- Type: `string` | ||
- Default: `SiteConfig.description` | ||
|
||
Channel description | ||
|
||
## channel.language | ||
|
||
- Type: `string` | ||
|
||
- Default: | ||
- `siteConfig.locales['/'].lang` | ||
- If the above is not provided, fall back to `"en-US"` | ||
|
||
The language of the channel | ||
|
||
## channel.copyright | ||
|
||
- Type: `string` | ||
|
||
- Default: | ||
|
||
- Try to read the `author.name` in channel options, and fall back to `Copyright by $author` | ||
|
||
- Recommended to set manually: **Yes** | ||
|
||
Channel copyright information | ||
|
||
## channel.pubDate | ||
|
||
- Type: `string` (must be a valid Date ISOString) | ||
- Default: time when the plugin is called each time | ||
- Recommended to set manually: **Yes** | ||
|
||
Publish date of the Channel | ||
|
||
## channel.lastUpdated | ||
|
||
- Type: `string` (must be a valid Date ISOString) | ||
- Default: time when the plugin is called each time | ||
|
||
Last update time of channel content | ||
|
||
## channel.ttl | ||
|
||
- Type: `number` | ||
- Recommended to set manually: **Yes** | ||
|
||
The effective time of the content. It's the time to keep the cache after request without making new requests. | ||
|
||
## channel.image | ||
|
||
- Type: `string` | ||
- Recommended to set manually: **Yes** | ||
|
||
A picture presenting the channel. A square picture with a size not smaller than 512×512 is recommended. | ||
|
||
## channel.icon | ||
|
||
- Type: `string` | ||
- Recommended to set manually: **Yes** | ||
|
||
An icon representing a channel, a square picture, with not less than 128×128 in size, and transparent background color is recommended. | ||
|
||
## channel.author | ||
|
||
- Type: `FeedAuthor` | ||
- Recommended to set manually: **Yes** | ||
|
||
The author of the channel. | ||
|
||
::: details FeedAuthor format | ||
|
||
```ts | ||
interface FeedAuthor { | ||
/** Author name */ | ||
name: string; | ||
/** Author's email */ | ||
email?: string; | ||
/** Author's site */ | ||
url?: string; | ||
/** | ||
* Author's avatar address | ||
* | ||
* Square, preferably not less than 128×128 with transparent background | ||
*/ | ||
avatar?: string; | ||
} | ||
``` | ||
|
||
## channel.hub | ||
|
||
- Type: `string` | ||
|
||
Link to Websub. Websub requires a server backend, which is inconsistent with VuePress, so ignore it if there is no special need. | ||
|
||
::: tip WebSub | ||
|
||
For details, see [Websub](https://w3c.github.io/websub/#subscription-migration). | ||
|
||
::: |
Oops, something went wrong.