docs: add guides (#258)

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-12-15 10:19:16 +01:00
committed by GitHub
parent 28692d82ae
commit 3d8a3e8997
31 changed files with 4491 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
import { getAllCompareSlugs, getCompareData } from '@/lib/compare';
import { url as baseUrl } from '@/lib/layout.shared';
import { articleSource, pageSource, source } from '@/lib/source';
import { articleSource, guideSource, pageSource, source } from '@/lib/source';
import { ImageResponse } from 'next/og';
import type { NextRequest } from 'next/server';
@@ -62,6 +62,20 @@ async function getOgData(
description: data?.seo.description || data?.hero.subheading,
};
}
case 'guides': {
if (segments.length > 1) {
const data = await guideSource.getPage(segments.slice(1));
return {
title: data?.data.title ?? 'Guide Not Found',
description:
data?.data.description || 'Whooops, could not find this guide',
};
}
return {
title: 'Implementation Guides',
description: 'Step-by-step tutorials for adding analytics to your app',
};
}
case 'docs': {
const data = await source.getPage(segments.slice(1));
return {