Skip to content

Commit

Permalink
NEWIO_SITE-3626 split normal vs series feed.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurvanpasselia committed Dec 20, 2023
1 parent 2a8611d commit d7475a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pages/series/[...slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { formatSlug, getAllFilesFrontMatter, getFileBySlug, getFiles } from '@/l
import { getLatestJobs } from '@/lib/jobs'
import { getSerie } from '@/lib/series'
import JobGrid from '@/components/JobGrid'
import path from 'path'

const root = process.cwd()
const DEFAULT_LAYOUT = 'SerieLayout'

export async function getStaticPaths() {
Expand Down Expand Up @@ -38,8 +40,10 @@ export async function getStaticProps({ params }) {

// rss
if (allSeries.length > 0) {
const rss = await generateRss(allSeries)
fs.writeFileSync('./public/feed.xml', rss)
const rss = await generateRss(allSeries, '/series/feed.xml')
const rssPath = path.join(root, 'public', 'series')
fs.mkdirSync(rssPath, { recursive: true })
fs.writeFileSync('./public/series/feed.xml', rss)
}

const { jobs } = await getLatestJobs(4)
Expand Down

0 comments on commit d7475a3

Please sign in to comment.