Skip to content

Commit

Permalink
fix: generate rss & patch types
Browse files Browse the repository at this point in the history
  • Loading branch information
hta218 committed Aug 14, 2023
1 parent b19e634 commit d0c7b2d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion pages/blog/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export async function getStaticProps({
})
)

let rss = generateRss(getCommon(locale).siteMetadata, allPosts)
let { site_meta_data: metadata } = getCommon(locale)
let rss = generateRss(metadata, allPosts)
fs.writeFileSync('./public/feed.xml', rss)
let commentConfig = getCommentConfigs()

Expand Down
5 changes: 3 additions & 2 deletions pages/projects.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { PageSeo } from 'components/SEO'
import { useTranslation } from 'next-i18next'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { ProjectCard } from '~/components/ProjectCard'
import { useTranslation } from 'next-i18next'
import type { Project } from '~/types/data'

export async function getStaticProps({ locale }) {
let projectsDataModule = await import(`~/data/${locale}/projectsData.ts`)
Expand All @@ -15,7 +16,7 @@ export async function getStaticProps({ locale }) {
}
}

export default function Projects({ projectsData }) {
export default function Projects({ projectsData }: { projectsData: Project[] }) {
let workProjects = projectsData.filter(({ type }) => type === 'work')
let sideProjects = projectsData.filter(({ type }) => type === 'self')
let { t } = useTranslation('common')
Expand Down
7 changes: 2 additions & 5 deletions pages/tags/[tag].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@ export async function getStaticProps({
)

let root = process.cwd()
let rss = generateRss(
getCommon(locale).siteMetadata,
filteredPosts,
`tags/${params.tag}/feed.xml`
)
let { site_meta_data: metadata } = getCommon(locale)
let rss = generateRss(metadata, filteredPosts, `tags/${params.tag}/feed.xml`)
let rssPath = path.join(root, 'public', 'tags', params.tag)
fs.mkdirSync(rssPath, { recursive: true })
fs.writeFileSync(path.join(rssPath, 'feed.xml'), rss)
Expand Down

1 comment on commit d0c7b2d

@vercel
Copy link

@vercel vercel bot commented on d0c7b2d Aug 14, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

leo-huynh-dot-dev – ./

leo-huynh-dot-dev-git-main-hta218.vercel.app
leohuynh.dev
leo-huynh-dot-dev-hta218.vercel.app
www.leohuynh.dev

Please sign in to comment.