@rspress/plugin-rss 2.0.0-beta.13 → 2.0.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +5 -5
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import external_node_path_default, { dirname } from "node:path";
1
+ import node_path, { dirname } from "node:path";
2
2
  import { resolve } from "node:url";
3
3
  import { getIconUrlPath } from "@rspress/shared/node-utils";
4
4
  import { Feed } from "feed";
@@ -37,7 +37,7 @@ async function writeFile(path, content) {
37
37
  function generateFeedItem(page, siteUrl) {
38
38
  const { frontmatter: fm } = page;
39
39
  return {
40
- id: selectNonNullishProperty(fm.slug, fm.id, page.id) || '',
40
+ id: selectNonNullishProperty(fm.slug, fm.id, page.routePath) || '',
41
41
  title: selectNonNullishProperty(fm.title, page.title) || '',
42
42
  author: toAuthors(fm.author),
43
43
  link: resolve(siteUrl, selectNonNullishProperty(fm.permalink, page.routePath) || ''),
@@ -201,8 +201,8 @@ function pluginRss(pluginRssOptions) {
201
201
  },
202
202
  async extendPageData (pageData) {
203
203
  if (!_rssWorkaround) return;
204
- _rssWorkaround[pageData.id] = _rssWorkaround[pageData.id] || getRssItems(feedsSet.get(), pageData, _config, pluginRssOptions.siteUrl);
205
- const feeds = await _rssWorkaround[pageData.id];
204
+ _rssWorkaround[pageData.routePath] = _rssWorkaround[pageData.routePath] || getRssItems(feedsSet.get(), pageData, _config, pluginRssOptions.siteUrl);
205
+ const feeds = await _rssWorkaround[pageData.routePath];
206
206
  const showRssList = new Set(concatArray(pageData.frontmatter['link-rss']));
207
207
  for (const feed of feeds)showRssList.add(feed.channel);
208
208
  pageData.feeds = Array.from(showRssList, (id)=>{
@@ -225,7 +225,7 @@ function pluginRss(pluginRssOptions) {
225
225
  for (const [channel, feed] of Object.entries(feeds)){
226
226
  const { output } = feedsSet.get(channel);
227
227
  feed.items.sort(output.sorting);
228
- const path = external_node_path_default.resolve(config.outDir || 'doc_build', output.dir, output.filename);
228
+ const path = node_path.resolve(config.outDir || 'doc_build', output.dir, output.filename);
229
229
  await writeFile(path, output.getContent(feed));
230
230
  }
231
231
  _rssWorkaround = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/plugin-rss",
3
- "version": "2.0.0-beta.13",
3
+ "version": "2.0.0-beta.15",
4
4
  "description": "A plugin for rss generation for rspress",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -25,19 +25,19 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "feed": "^4.2.2",
28
- "@rspress/shared": "2.0.0-beta.13"
28
+ "@rspress/shared": "2.0.0-beta.15"
29
29
  },
30
30
  "devDependencies": {
31
- "@rslib/core": "0.9.2",
31
+ "@rslib/core": "0.10.0",
32
32
  "@types/node": "^22.8.1",
33
- "@types/react": "^19.1.6",
33
+ "@types/react": "^19.1.8",
34
34
  "react": "^19.1.0",
35
35
  "rsbuild-plugin-publint": "^0.3.2",
36
36
  "typescript": "^5.8.2",
37
- "@rspress/runtime": "2.0.0-beta.13"
37
+ "@rspress/runtime": "2.0.0-beta.15"
38
38
  },
39
39
  "peerDependencies": {
40
- "rspress": "^2.0.0-beta.13"
40
+ "rspress": "^2.0.0-beta.15"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=18.0.0"