Roadmap to becoming a developer in 2022
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.
 
 
 
 
 

42 lines
1.1 KiB

---
import GuideContent from '../../components/Guide/GuideContent.astro';
import GuideHeader from '../../components/GuideHeader.astro';
import BaseLayout from '../../layouts/BaseLayout.astro';
import { getAllGuides, type GuideFileType } from '../../lib/guide';
import { getOpenGraphImageUrl } from '../../lib/open-graph';
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 = getOpenGraphImageUrl({
group: 'guides',
resourceId: guideId,
});
---
<BaseLayout
title={guideData.seo.title}
description={guideData.seo.description}
permalink={`/guides/${guideId}`}
canonicalUrl={guideData.canonicalUrl}
ogImageUrl={ogImageUrl}
>
<GuideHeader guide={guide} />
<GuideContent guide={guide!} />
</BaseLayout>