From f6a4acd8c2f34be86007b2af96640b9a3c3da21b Mon Sep 17 00:00:00 2001 From: Charles Teague Date: Mon, 4 Dec 2023 13:20:21 -0500 Subject: [PATCH] Resolve website inputs even when there is no theme fixes #6285 --- .../types/website/website-navigation.ts | 22 +++++++++++++++++++ src/project/types/website/website.ts | 9 +++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/project/types/website/website-navigation.ts b/src/project/types/website/website-navigation.ts index 6eae295034..8c5177e8c0 100644 --- a/src/project/types/website/website-navigation.ts +++ b/src/project/types/website/website-navigation.ts @@ -190,6 +190,28 @@ export async function initWebsiteNavigation(project: ProjectContext) { navigation.pageMargin = pageMargin; } +export async function websiteNoThemeExtras( + project: ProjectContext, + source: string, + _flags: PandocFlags, + _format: Format, + _temp: TempContext, +): Promise { + return { + html: { + [kHtmlPostprocessors]: [ + async (doc: Document): Promise => { + await resolveProjectInputLinks(source, project, doc); + return Promise.resolve({ + resources: [], + supporting: [], + }); + }, + ], + }, + }; +} + export async function websiteNavigationExtras( project: ProjectContext, source: string, diff --git a/src/project/types/website/website.ts b/src/project/types/website/website.ts index 0cb4156c18..962467ced0 100644 --- a/src/project/types/website/website.ts +++ b/src/project/types/website/website.ts @@ -42,6 +42,7 @@ import { ensureIndexPage, initWebsiteNavigation, websiteNavigationExtras, + websiteNoThemeExtras, } from "./website-navigation.ts"; import { updateSitemap } from "./website-sitemap.ts"; @@ -132,7 +133,13 @@ export const websiteProjectType: ProjectType = { format, services.temp, ) - : {}; + : await websiteNoThemeExtras( + project, + source, + flags, + format, + services.temp, + ); // add some title related variables extras.pandoc = extras.pandoc || {};