Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
feat: rename feed plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jun 3, 2022
1 parent d265df7 commit 33e0609
Show file tree
Hide file tree
Showing 34 changed files with 92 additions and 197 deletions.
2 changes: 1 addition & 1 deletion docs/feed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "feed-docs",
"version": "1.30.0",
"private": true,
"description": "Docs for @mr-hope/vuepress-plugin-feed",
"description": "Docs for vuepress-plugin-feed1",
"license": "MIT",
"author": {
"name": "Mr.Hope",
Expand Down
2 changes: 1 addition & 1 deletion docs/feed/src/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default hope.config({
color: "#ffffff",
},
manifest: {
name: "@mr-hope/vuepress-plugin-feed",
name: "vuepress-plugin-feed1",
short_name: "feed plugin",
icons: [
{
Expand Down
10 changes: 5 additions & 5 deletions docs/feed/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ home: true
title: Home
icon: home
heroImage: /logo.svg
heroText: "@mr-hope/vuepress-plugin-feed"
heroText: "vuepress-plugin-feed1"
tagline: Feed plugin for vuepress
action:
- text: Guide 💡
Expand All @@ -26,15 +26,15 @@ copyrightText: false
::: code-group-item yarn

```bash
yarn add -D @mr-hope/vuepress-plugin-feed
yarn add -D vuepress-plugin-feed1
```

:::

::: code-group-item npm

```bash
npm i -D @mr-hope/vuepress-plugin-feed
npm i -D vuepress-plugin-feed1
```

:::
Expand All @@ -52,7 +52,7 @@ npm i -D @mr-hope/vuepress-plugin-feed
export default {
plugins: [
[
"@mr-hope/feed",
"feed1",
{
// your options
},
Expand All @@ -70,7 +70,7 @@ export default {
module.exports = {
plugins: [
[
"@mr-hope/feed",
"feed1",
{
// your options
},
Expand Down
2 changes: 1 addition & 1 deletion docs/feed/src/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ icon: creative

## Usage

The `@mr-hope/vuepress-plugin-feed` plugin can generate feed files in the following three formats for you:
The `vuepress-plugin-feed1` plugin can generate feed files in the following three formats for you:

- Atom 1.0
- JSON 1.1
Expand Down
10 changes: 5 additions & 5 deletions docs/feed/src/zh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ home: true
title: 主页
icon: home
heroImage: /logo.svg
heroText: "@mr-hope/vuepress-plugin-feed"
heroText: "vuepress-plugin-feed1"
tagline: 为 VuePress 提供 Feed 生成
action:
- text: 快速上手 💡
Expand All @@ -26,15 +26,15 @@ copyrightText: false
::: code-group-item yarn

```bash
yarn add -D @mr-hope/vuepress-plugin-feed
yarn add -D vuepress-plugin-feed1
```

:::

::: code-group-item npm

```bash
npm i -D @mr-hope/vuepress-plugin-feed
npm i -D vuepress-plugin-feed1
```

:::
Expand All @@ -48,7 +48,7 @@ npm i -D @mr-hope/vuepress-plugin-feed
module.exports = {
plugins: [
[
"@mr-hope/feed",
"feed1",
{
// 你的选项
},
Expand All @@ -66,7 +66,7 @@ module.exports = {
export default {
plugins: [
[
"@mr-hope/feed",
"feed1",
{
// 你的选项
},
Expand Down
2 changes: 1 addition & 1 deletion docs/feed/src/zh/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ icon: creative

## 使用

`@mr-hope/vuepress-plugin-feed` 插件可为你生成以下三种格式的 feed 文件:
`vuepress-plugin-feed1` 插件可为你生成以下三种格式的 feed 文件:

- Atom 1.0
- JSON 1.1
Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/config/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tags:

- [vuepress-plugin-copy-code1][copy-code]: Provide copy button for code blocks

- [@mr-hope/vuepress-plugin-feed][feed]: Feed generation support
- [vuepress-plugin-feed1][feed]: Feed generation support

- [@mr-hope/vuepress-plugin-git][git]: Info plugin based on git

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ The theme also includes the following plugins, you can use them in other themes

- [vuepress-plugin-copy-code1][copy-code]: Provide copy button for code blocks

- [@mr-hope/vuepress-plugin-feed][feed]: Feed support
- [vuepress-plugin-feed1][feed]: Feed support

- [@mr-hope/vuepress-plugin-git][git]: Info plugin based on git

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/guide/feature/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The theme includes the following plugins, you can use them directly in other the

- [vuepress-plugin-copy-code1][copy-code]: Provide copy button for code blocks

- [@mr-hope/vuepress-plugin-feed][feed]: Feed support
- [vuepress-plugin-feed1][feed]: Feed support

- [@mr-hope/vuepress-plugin-git][git]: Info based on git

Expand Down
4 changes: 2 additions & 2 deletions docs/theme/src/guide/feature/feed.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ tags:
- feed
---

The theme will enable feed generation support using [`@mr-hope/vuepress-plugin-feed`](https://vuepress-theme-hope.github.io/v1/feed/) by default.
The theme will enable feed generation support using [`vuepress-plugin-feed1`](https://vuepress-theme-hope.github.io/v1/feed/) by default.

`@mr-hope/vuepress-plugin-feed` plugin will automatically generate feed in the following three formats for you
`vuepress-plugin-feed1` plugin will automatically generate feed in the following three formats for you

- Atom 1.0 (Default output: atom.xml)
- JSON 1.1 (Default output: feed.json)
Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/zh/config/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tags:

- [vuepress-plugin-copy-code1][copy-code]: 提供一键复制代码块功能。

- [@mr-hope/vuepress-plugin-feed][feed]: 提供 Feed 生成
- [vuepress-plugin-feed1][feed]: 提供 Feed 生成

- [@mr-hope/vuepress-plugin-git][git]: 基于 Git 的页面信息插件

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/zh/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ tags:

- [vuepress-plugin-copy-code1][copy-code]: 提供一键复制代码块功能。

- [@mr-hope/vuepress-plugin-feed][feed]: Feed 支持
- [vuepress-plugin-feed1][feed]: Feed 支持

- [@mr-hope/vuepress-plugin-git][git]: 基于 Git 的页面信息插件

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/zh/guide/feature/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tags:

- [vuepress-plugin-copy-code1][copy-code]: 提供一键复制代码块功能。

- [@mr-hope/vuepress-plugin-feed][feed]: Feed 支持
- [vuepress-plugin-feed1][feed]: Feed 支持

- [@mr-hope/vuepress-plugin-git][git]: 基于 Git 的页面信息插件

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/zh/guide/feature/feed.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags:
- feature
---

`vuepress-theme-hope` 通过内置 [`@mr-hope/vuepress-plugin-feed`](https://vuepress-theme-hope.github.io/v1/feed/zh/) 插件来为你提供 feed 支持。
`vuepress-theme-hope` 通过内置 [`vuepress-plugin-feed1`](https://vuepress-theme-hope.github.io/v1/feed/zh/) 插件来为你提供 feed 支持。

主题会自动为你生成以下三种格式的 feed 文件:

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"@commitlint/cli": "17.0.2",
"@commitlint/config-conventional": "17.0.2",
"@mr-hope/vuepress-plugin-components": "workspace:*",
"@mr-hope/vuepress-plugin-feed": "workspace:*",
"@mr-hope/vuepress-plugin-git": "workspace:*",
"@mr-hope/vuepress-plugin-pwa": "workspace:*",
"@mr-hope/vuepress-plugin-reading-time": "workspace:*",
Expand Down Expand Up @@ -101,6 +100,7 @@
"vuepress-plugin-add-this": "workspace:*",
"vuepress-plugin-comment1": "workspace:*",
"vuepress-plugin-copy-code1": "workspace:*",
"vuepress-plugin-feed1": "workspace:*",
"vuepress-plugin-md-enhance": "workspace:*",
"vuepress-plugin-photo-swipe": "workspace:*",
"vuepress-shared": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions packages/feed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<p align="center">
<img width="240" src="https://vuepress-theme-hope.github.io/v1/logo.svg" style="text-align: center;"/>
</p>
<h1 align="center">@mr-hope/vuepress-plugin-feed</h1>
<h1 align="center">vuepress-plugin-feed1</h1>
<h4 align="center">VuePress feed plugin 📡 / VuePress Feed 插件 📡</h4>

[![Version](https://img.shields.io/npm/v/@mr-hope/vuepress-plugin-feed.svg?style=flat-square&logo=npm) ![Downloads](https://img.shields.io/npm/dm/@mr-hope/vuepress-plugin-feed.svg?style=flat-square&logo=npm) ![Size](https://img.shields.io/bundlephobia/min/@mr-hope/vuepress-plugin-feed?style=flat-square&logo=npm)](https://www.npmjs.com/package/@mr-hope/vuepress-plugin-feed)
[![Version](https://img.shields.io/npm/v/vuepress-plugin-feed1.svg?style=flat-square&logo=npm) ![Downloads](https://img.shields.io/npm/dm/vuepress-plugin-feed1.svg?style=flat-square&logo=npm) ![Size](https://img.shields.io/bundlephobia/min/vuepress-plugin-feed1?style=flat-square&logo=npm)](https://www.npmjs.com/package/vuepress-plugin-feed1)

<!-- markdownlint-restore -->

Expand All @@ -22,11 +22,11 @@ VuePress 2 is recommanded to start new project. You should use [`vuepress-plugin
## Usage / 使用

```bash
npm i -D @mr-hope/vuepress-plugin-feed
npm i -D vuepress-plugin-feed1
```

or

```bash
yarn add -D @mr-hope/vuepress-plugin-feed
yarn add -D vuepress-plugin-feed1
```
2 changes: 1 addition & 1 deletion packages/feed/__tests__/__snapshots__/atom.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports[`Atom 1.0 > should generate a valid feed 1`] = `
<uri>https://example.com/johndoe?link=sanitized&amp;value=2</uri>
</author>
<updated>2013-07-13T23:00:00.000Z</updated>
<generator>@mr-hope/vuepress-plugin-feed</generator>
<generator>vuepress-plugin-feed1</generator>
<link rel=\\"self\\" href=\\"http://example.com/atom.xml\\"/>
<link rel=\\"alternate\\" href=\\"http://example.com/\\"/>
<link rel=\\"hub\\" href=\\"wss://example.com/\\"/>
Expand Down
10 changes: 5 additions & 5 deletions packages/feed/__tests__/__snapshots__/rss.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports[`RSS 2.0 > should generate a valid feed 1`] = `
<language>en</language>
<pubDate>Wed, 10 Jul 2013 23:00:00 GMT</pubDate>
<lastBuildDate>Sat, 13 Jul 2013 23:00:00 GMT</lastBuildDate>
<generator>@mr-hope/vuepress-plugin-feed</generator>
<generator>vuepress-plugin-feed1</generator>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<copyright>All rights reserved 2013, John Doe</copyright>
<ttl>60</ttl>
Expand Down Expand Up @@ -49,7 +49,7 @@ exports[`RSS 2.0 > should generate a valid feed with audio 1`] = `
<language>en</language>
<pubDate>Wed, 10 Jul 2013 23:00:00 GMT</pubDate>
<lastBuildDate>Sat, 13 Jul 2013 23:00:00 GMT</lastBuildDate>
<generator>@mr-hope/vuepress-plugin-feed</generator>
<generator>vuepress-plugin-feed1</generator>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<copyright>All rights reserved 2013, John Doe</copyright>
<ttl>60</ttl>
Expand Down Expand Up @@ -126,7 +126,7 @@ exports[`RSS 2.0 > should generate a valid feed with enclosure 1`] = `
<language>en</language>
<pubDate>Wed, 10 Jul 2013 23:00:00 GMT</pubDate>
<lastBuildDate>Sat, 13 Jul 2013 23:00:00 GMT</lastBuildDate>
<generator>@mr-hope/vuepress-plugin-feed</generator>
<generator>vuepress-plugin-feed1</generator>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<copyright>All rights reserved 2013, John Doe</copyright>
<ttl>60</ttl>
Expand Down Expand Up @@ -190,7 +190,7 @@ exports[`RSS 2.0 > should generate a valid feed with image properties 1`] = `
<language>en</language>
<pubDate>Wed, 10 Jul 2013 23:00:00 GMT</pubDate>
<lastBuildDate>Sat, 13 Jul 2013 23:00:00 GMT</lastBuildDate>
<generator>@mr-hope/vuepress-plugin-feed</generator>
<generator>vuepress-plugin-feed1</generator>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<copyright>All rights reserved 2013, John Doe</copyright>
<ttl>60</ttl>
Expand Down Expand Up @@ -241,7 +241,7 @@ exports[`RSS 2.0 > should generate a valid feed with video 1`] = `
<language>en</language>
<pubDate>Wed, 10 Jul 2013 23:00:00 GMT</pubDate>
<lastBuildDate>Sat, 13 Jul 2013 23:00:00 GMT</lastBuildDate>
<generator>@mr-hope/vuepress-plugin-feed</generator>
<generator>vuepress-plugin-feed1</generator>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<copyright>All rights reserved 2013, John Doe</copyright>
<ttl>60</ttl>
Expand Down
2 changes: 1 addition & 1 deletion packages/feed/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@mr-hope/vuepress-plugin-feed",
"name": "vuepress-plugin-feed1",
"version": "1.30.0",
"description": "Feed plugin for vuepress-theme-hope",
"keywords": [
Expand Down
3 changes: 2 additions & 1 deletion packages/feed/src/node/atom/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { encodeCDATA, encodeXML } from "vuepress-shared";
import { js2xml } from "xml-js";
import { encodeCDATA, encodeXML, FEED_GENERATOR } from "../utils";
import { FEED_GENERATOR } from "../utils";

import type { Feed } from "../feed";
import type { FeedAuthor, FeedCategory } from "../../types";
Expand Down
10 changes: 5 additions & 5 deletions packages/feed/src/node/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { dirname, resolve } from "path";
import { Feed } from "./feed";
import { getFeedChannelOption, getFilename, getFeedLinks } from "./options";
import { FeedPage } from "./page";
import { compareDate, success } from "./utils";
import { compareDate, logger } from "./utils";

import type { Context, Page } from "vuepress-typings";
import type { ResolvedFeedOptionsMap } from "./options";
Expand Down Expand Up @@ -78,7 +78,7 @@ export class FeedGenerator {
}
}

success(
logger.succeed(
`added ${cyan(`${count} page(s)`)} as feed item(s) in route ${cyan(
localePath
)}`
Expand All @@ -105,7 +105,7 @@ export class FeedGenerator {
await ensureDir(dirname(filePath));
await outputFile(filePath, feed.atom());

success(
logger.succeed(
`Atom feed file generated and saved to ${cyan(
atomOutputFilename
)}`
Expand All @@ -119,7 +119,7 @@ export class FeedGenerator {
await ensureDir(dirname(filePath));
await outputFile(filePath, feed.json());

success(
logger.succeed(
`JSON feed file generated and saved to ${cyan(
jsonOutputFilename
)}`
Expand All @@ -133,7 +133,7 @@ export class FeedGenerator {
await ensureDir(dirname(filePath));
await outputFile(filePath, feed.rss());

success(
logger.succeed(
`RSS feed file generated and saved to ${cyan(rssOutputFilename)}`
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/feed/src/node/json/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { stripTags } from "../stripTags";
import { stripTags } from "vuepress-shared";

import type { Feed } from "../feed";
import type { FeedAuthor } from "../../types";
Expand Down
Loading

0 comments on commit 33e0609

Please sign in to comment.