Skip to content

Commit

Permalink
feat: add meta description into leading pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatic174 committed Aug 17, 2023
1 parent 4209c99 commit b8c19cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export interface LeadingPage {
description?: TextItems;
meta?: {
title?: TextItems;
description?: TextItems;
noIndex?: boolean;
};
nav?: {
Expand Down
9 changes: 9 additions & 0 deletions src/services/leading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ function filterFile(path: string) {
parsedIndex.meta.title = liquidField(metaTitle, combinedVars, path);
}

if (parsedIndex.meta?.description) {
const metaDescription = firstFilterTextItems(
parsedIndex.meta.description,
combinedVars,
{resolveConditions: true},
);
parsedIndex.meta.description = liquidField(metaDescription, combinedVars, path);
}

if (parsedIndex.nav) {
const navTitle = firstFilterTextItems(
parsedIndex.nav.title,
Expand Down

0 comments on commit b8c19cd

Please sign in to comment.