diff --git a/CHANGELOG.pod6 b/CHANGELOG.pod6 index a605c82..456c1c3 100644 --- a/CHANGELOG.pod6 +++ b/CHANGELOG.pod6 @@ -2,6 +2,10 @@ =head1 Upcoming +=head1 0.2.3 + +=item fix rss.xml file generation + =head1 0.2.2 =item average page size optimization (reduction up to 2-3 times) diff --git a/package.json b/package.json index 4d0a9b4..0aa10e2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "podlite-web", "description": "📖 Create static websites with Next.js and the Podlite markup language.", - "version": "0.2.2", + "version": "0.2.3", "private": true, "scripts": { "next_dev": "next dev", diff --git a/src/utils/rss.tsx b/src/utils/rss.tsx index e062ff1..5a52aa2 100644 --- a/src/utils/rss.tsx +++ b/src/utils/rss.tsx @@ -1,9 +1,9 @@ import { DataFeedContent } from '../../bin/makeDataSource' -import { DATA_PATH, PUBLIC_PATH } from '../constants' +import { PUBLIC_PATH } from '../constants' import { getSiteInfo } from '../utils' import * as fs from 'fs' import { convertPodNodeToHtml as convertPodNodeToHtml } from '../utils' -import { getData } from 'src/serverside' +import { getAllPages } from 'src/serverside' export function getRssForData(data: DataFeedContent) { const conf = data.siteInfo @@ -35,8 +35,7 @@ ${pages ` } export function writeRss() { - const dataFeed = getData() - const pages = dataFeed.all + const pages = getAllPages() .filter(a => a.pubdate) .filter(page => page.description) .sort((a, b) => { @@ -46,6 +45,6 @@ export function writeRss() { .reverse() .splice(0, 10) //@ts-ignore - const rss = getRssForData({ ...dataFeed, all: pages, siteInfo: getSiteInfo() }) + const rss = getRssForData({ all: pages, siteInfo: getSiteInfo() }) fs.writeFileSync(`${PUBLIC_PATH}/rss.xml`, rss) }