Skip to content

Commit c2cdf39

Browse files
committed
fix rss.xml file generation
1 parent ea6c315 commit c2cdf39

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

CHANGELOG.pod6

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
33
=head1 Upcoming
44
5+
=head1 0.2.3
6+
7+
=item fix rss.xml file generation
8+
59
=head1 0.2.2
610
711
=item average page size optimization (reduction up to 2-3 times)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "podlite-web",
33
"description": "📖 Create static websites with Next.js and the Podlite markup language.",
4-
"version": "0.2.2",
4+
"version": "0.2.3",
55
"private": true,
66
"scripts": {
77
"next_dev": "next dev",

src/utils/rss.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { DataFeedContent } from '../../bin/makeDataSource'
2-
import { DATA_PATH, PUBLIC_PATH } from '../constants'
2+
import { PUBLIC_PATH } from '../constants'
33
import { getSiteInfo } from '../utils'
44
import * as fs from 'fs'
55
import { convertPodNodeToHtml as convertPodNodeToHtml } from '../utils'
6-
import { getData } from 'src/serverside'
6+
import { getAllPages } from 'src/serverside'
77

88
export function getRssForData(data: DataFeedContent) {
99
const conf = data.siteInfo
@@ -35,8 +35,7 @@ ${pages
3535
`
3636
}
3737
export function writeRss() {
38-
const dataFeed = getData()
39-
const pages = dataFeed.all
38+
const pages = getAllPages()
4039
.filter(a => a.pubdate)
4140
.filter(page => page.description)
4241
.sort((a, b) => {
@@ -46,6 +45,6 @@ export function writeRss() {
4645
.reverse()
4746
.splice(0, 10)
4847
//@ts-ignore
49-
const rss = getRssForData({ ...dataFeed, all: pages, siteInfo: getSiteInfo() })
48+
const rss = getRssForData({ all: pages, siteInfo: getSiteInfo() })
5049
fs.writeFileSync(`${PUBLIC_PATH}/rss.xml`, rss)
5150
}

0 commit comments

Comments
 (0)