Skip to content

Commit

Permalink
Merge pull request #223 from arthur-vanpassel/develop
Browse files Browse the repository at this point in the history
NEWIO_SITE-3626 split normal vs series feed.xml
  • Loading branch information
sanderdejong88 authored Dec 27, 2023
2 parents 1aaa400 + d7475a3 commit 3a9bd21
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

1 comment on commit 3a9bd21

@vercel
Copy link

@vercel vercel bot commented on 3a9bd21 Dec 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.