This commit is contained in:
taskylizard 2023-11-06 21:46:23 +05:30
parent cc91903e2b
commit 580deea601
No known key found for this signature in database
GPG key ID: 5CABA3D642DDC497
2 changed files with 5 additions and 20 deletions

View file

@ -40,9 +40,7 @@ export async function generateImages(config: SiteConfig) {
},
];
const filteredPages = pages.filter((p) => p.frontmatter.image === undefined);
for (const page of filteredPages) {
for (const page of pages) {
await generateImage({
page,
template,
@ -59,17 +57,6 @@ interface GenerateImagesOptions {
fonts: SatoriOptions["fonts"];
}
function getDir(url: string) {
if (url.startsWith("/glossary/")) {
return "Glossary";
} else if (url.startsWith("/guides/")) {
return "Guide";
}
// Means we are at root.
return undefined;
}
async function generateImage({ page, template, outDir, fonts }: GenerateImagesOptions) {
const { frontmatter, url } = page;
@ -86,7 +73,6 @@ async function generateImage({ page, template, outDir, fonts }: GenerateImagesOp
frontmatter.layout === "home"
? frontmatter.hero.tagline ?? frontmatter.description
: frontmatter.description,
dir: getDir(url),
},
};