diff options
Diffstat (limited to 'nuldoc-src/templates/utils.ts')
| -rw-r--r-- | nuldoc-src/templates/utils.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/nuldoc-src/templates/utils.ts b/nuldoc-src/templates/utils.ts index 65dd506..018c460 100644 --- a/nuldoc-src/templates/utils.ts +++ b/nuldoc-src/templates/utils.ts @@ -33,3 +33,19 @@ export async function stylesheetLinkElement( const hash = toHashString(await crypto.subtle.digest("MD5", content), "hex"); return el("link", [["rel", "stylesheet"], ["href", `${fileName}?h=${hash}`]]); } + +export function metaElement(attrs: [string, string][]): Element { + return el("meta", attrs); +} + +export function linkElement( + rel: string, + href: string, + type: string | null, +): Element { + const attrs: [string, string][] = [["rel", rel], ["href", href]]; + if (type !== null) { + attrs.push(["type", type]); + } + return el("link", attrs); +} |
