From 8fa1093a72bef05a31d564b2d3e8ef27e4a8f034 Mon Sep 17 00:00:00 2001 From: Jared Krinke Date: Wed, 8 Dec 2021 21:33:15 -0800 Subject: [PATCH] Fix absolute navigation links --- templates.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates.ts b/templates.ts index a110e14..316f4bb 100644 --- a/templates.ts +++ b/templates.ts @@ -237,6 +237,10 @@ interface PartialBaseOptions { headVerbatim?: string; } +function isRelativeLink(href: string): boolean { + return !(href.startsWith("/") || href.includes(":")); +} + const partialBase = (m: GoldsmithLiteralHTMLLayoutContext, mainVerbatim: string, o?: PartialBaseOptions) => html` @@ -255,7 +259,7 @@ ${{verbatim: o?.headVerbatim ?? ""}}

${m.site!.title!}

${{verbatim: m.site?.header?.text ? html`

${m.site.header.text}

` : ""}} ${{verbatim: (m.site?.header?.links && Object.keys(m.site.header.links).length > 0) ? html`` : ""}} ${{verbatim: o?.navigationVerbatim ?? ""}}