From 28cdaaaad51bb3d4623e17f18413a1584659fb2f Mon Sep 17 00:00:00 2001 From: Nicholas Berlette Date: Sat, 23 Apr 2022 23:58:48 -0700 Subject: [PATCH] Update config.ts --- docs/.vitepress/config.ts | 98 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 5 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 0c012b1..3ff6090 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,14 +1,102 @@ -import { defineConfig } from 'vitepress' +import type { DefaultTheme, HeadConfig } from 'vitepress'; +import { defineConfig } from 'vitepress'; + +const head: HeadConfig[] = [ + [ + 'link', { + 'rel': 'prefetch', + 'as': 'style', + 'type': 'text/css;charset=utf-8', + 'href': 'https://cdn.jsdelivr.net/npm/@typehaus/metropolis/index.css', + 'crossorigin': 'anonymous', + } + ], + [ + 'link', { + 'rel': 'prefetch', + 'as': 'module', + 'type': 'application/javascript;charset=utf-8', + 'href': 'https://cdn.jsdelivr.net/npm/windicss-runtime-dom', + 'crossorigin': 'anonymous', + } + ], + [ + 'link', + { + 'rel': 'prefetch', + 'as': 'icon', + 'type': 'image/svg+xml;charset=utf-8', + 'href': '/favicon.svg', + } + ], + [ + 'link', + { + 'rel': 'icon', + 'type': 'image/svg+xml;charset=utf-8', + 'href': '/favicon.svg', + } + ], + [ + 'link', + { + 'rel': 'stylesheet', + 'type': 'text/css;charset=utf-8', + 'href': 'https://cdn.jsdelivr.net/npm/@typehaus/metropolis/index.css', + 'crossorigin': 'anonymous', + } + ], + [ + 'script', { + 'type': 'module', + 'src': 'https://cdn.jsdelivr.net/npm/windicss-runtime-dom', + 'crossorigin': 'anonymous', + } + ], + [ + 'link', + { + 'rel': 'mask-icon', + 'type': 'image/svg+xml;charset=utf-8', + 'href': '/favicon.svg', + 'color': '#112233', + } + ], + [ + 'meta', + { + 'name': 'theme-color', + 'content': '#112233', + 'value': '#112233', + } + ], +]; + +const nav: DefaultTheme.NavItem[] = [ + { + text: 'Downloads', + target: '_blank', + rel: 'noopener', + ariaLabel: 'Download Fonts from GitHub Repository', + link: 'https://github.com/typehaus/metropolis/tree/main/dist' + }, + { + text: 'Discussions', + target: '_blank', + rel: 'noopener', + ariaLabel: 'GitHub Discussions', + link: 'https://github.com/typehaus/metropolis/discussions' + } +]; export default defineConfig({ lang: 'en-US', - title: 'Metropolis', + title: 'typehaus/metropolis', base: '/', + head: head, themeConfig: { + nav: nav, logo: '/favicon.svg', - head: [ - '', - ], repo: 'typehaus/metropolis', docsDir: 'docs', docsBranch: 'main',