computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
--- |
|
import GuideContent from '../../components/Guide/GuideContent.astro'; |
|
import BaseLayout from '../../layouts/BaseLayout.astro'; |
|
import { getAllGuides, type GuideFileType } from '../../lib/guide'; |
|
import { getOpenGraphImageUrl } from '../../lib/open-graph'; |
|
import { replaceVariables } from '../../lib/markdown'; |
|
|
|
export interface Props { |
|
guide: GuideFileType; |
|
} |
|
|
|
export async function getStaticPaths() { |
|
const guides = (await getAllGuides()).filter( |
|
(guide) => !guide.frontmatter.excludedBySlug, |
|
); |
|
|
|
return guides.map((guide) => ({ |
|
params: { guideId: guide.id }, |
|
props: { guide }, |
|
})); |
|
} |
|
|
|
const { guideId } = Astro.params; |
|
const { guide } = Astro.props; |
|
const { frontmatter: guideData, author } = guide; |
|
|
|
const ogImageUrl = |
|
guideData.seo.ogImageUrl || |
|
getOpenGraphImageUrl({ |
|
group: 'guide', |
|
resourceId: guideId, |
|
}); |
|
--- |
|
|
|
<BaseLayout |
|
title={guideData.seo.title} |
|
description={guideData.seo.description} |
|
permalink={`/guides/${guideId}`} |
|
canonicalUrl={guideData.canonicalUrl} |
|
ogImageUrl={ogImageUrl} |
|
> |
|
<GuideContent guide={guide!} /> |
|
|
|
<div slot="changelog-banner" /> |
|
</BaseLayout>
|
|
|