diff --git a/.vitepress/config.mts b/.vitepress/config.mts index ac15ce5..70d4525 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -12,14 +12,14 @@ export default defineConfigWithTheme({ ['link', { rel: 'alternate', href: 'https://koehr.in' }], ['link', { rel: 'alternate', href: 'https://koehr.ing' }], ['link', { rel: 'canonical', href: 'https://koehr.ing' }], - ['meta', { content: "The personal page and weblog of Norman Köhring" name: "description" }], - ['meta', { content: "Norman Köhring" name: "author" }], - ['meta', { content: "the codeartist — programmer and engineer based in Berlin" name: "DC.title" }], - ['meta', { content: "52.4595, 13.5335" name: "ICBM" }], - ['meta', { content: "52.4595; 13.5335" name: "geo.position" }], - ['meta', { content: "DE-BE" name: "geo.region" }], - ['meta', { content: "Berlin" name: "geo.placename" }], - ['meta', { content: "width=device-width,initial-scale=1.0" name: "viewport" }], + ['meta', { content: "The personal page and weblog of Norman Köhring", name: "description" }], + ['meta', { content: "Norman Köhring", name: "author" }], + ['meta', { content: "the codeartist — programmer and engineer based in Berlin", name: "DC.title" }], + ['meta', { content: "52.4595, 13.5335", name: "ICBM" }], + ['meta', { content: "52.4595; 13.5335", name: "geo.position" }], + ['meta', { content: "DE-BE", name: "geo.region" }], + ['meta', { content: "Berlin", name: "geo.plac,ename" }], + ['meta', { content: "width=device-width,initial-scale=1.0", name: "viewport" }], ], themeConfig: { commands: [{ @@ -36,7 +36,7 @@ export default defineConfigWithTheme({ }] }, { command: 'contact', - aliases: ['email'], + aliases: ['email', 'homepage', 'www'], help: 'How to contact Norman Köhring?', message: [ '# other servers', diff --git a/.vitepress/theme/Layout.vue b/.vitepress/theme/Layout.vue index be55834..5efef32 100644 --- a/.vitepress/theme/Layout.vue +++ b/.vitepress/theme/Layout.vue @@ -29,9 +29,12 @@ onMounted(() => { return } - const { addText, clear, footerLinks } = useTerminal(textArea.value, commands.value) - clear() - addText('Hello World!') + const { addText, addLine, clear, footerLinks } = useTerminal(textArea.value, commands.value) + + watch(frontmatter, () => { + addText(title.value + '\n', false) + addLine(content.value.join('\n')) + }, { immediate: true }) watch(footerLinks, () => { footer.value = footerLinks.value diff --git a/.vitepress/theme/useTerminal.ts b/.vitepress/theme/useTerminal.ts index 0e33111..341f74f 100644 --- a/.vitepress/theme/useTerminal.ts +++ b/.vitepress/theme/useTerminal.ts @@ -20,8 +20,8 @@ export default function useTerminal(inputEl: HTMLTextAreaElement, commands: Simp inputEl.focus() } - function addText(text: string) { - const line = text + prompt + function addText(text: string, addPrompt=true) { + const line = addPrompt ? text + prompt : text inputEl.value = inputEl.value + line inputEl.scrollTop = inputEl.scrollTopMax } @@ -31,6 +31,7 @@ export default function useTerminal(inputEl: HTMLTextAreaElement, commands: Simp } function clear() { + footerLinks.value = [] inputEl.value = '' addText('') }