fix meta, show welcome message

This commit is contained in:
koehr 2023-12-06 17:00:26 +01:00 committed by Norman Köhring
parent b6535f4a01
commit 30fd8ce3fe
3 changed files with 18 additions and 14 deletions

View file

@ -12,14 +12,14 @@ export default defineConfigWithTheme<ThemeConfig>({
['link', { rel: 'alternate', href: 'https://koehr.in' }], ['link', { rel: 'alternate', href: 'https://koehr.in' }],
['link', { rel: 'alternate', href: 'https://koehr.ing' }], ['link', { rel: 'alternate', href: 'https://koehr.ing' }],
['link', { rel: 'canonical', 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: "The personal page and weblog of Norman Köhring", name: "description" }],
['meta', { content: "Norman Köhring" name: "author" }], ['meta', { content: "Norman Köhring", name: "author" }],
['meta', { content: "the codeartist — programmer and engineer based in Berlin" name: "DC.title" }], ['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: "ICBM" }],
['meta', { content: "52.4595; 13.5335" name: "geo.position" }], ['meta', { content: "52.4595; 13.5335", name: "geo.position" }],
['meta', { content: "DE-BE" name: "geo.region" }], ['meta', { content: "DE-BE", name: "geo.region" }],
['meta', { content: "Berlin" name: "geo.placename" }], ['meta', { content: "Berlin", name: "geo.plac,ename" }],
['meta', { content: "width=device-width,initial-scale=1.0" name: "viewport" }], ['meta', { content: "width=device-width,initial-scale=1.0", name: "viewport" }],
], ],
themeConfig: { themeConfig: {
commands: [{ commands: [{
@ -36,7 +36,7 @@ export default defineConfigWithTheme<ThemeConfig>({
}] }]
}, { }, {
command: 'contact', command: 'contact',
aliases: ['email'], aliases: ['email', 'homepage', 'www'],
help: 'How to contact Norman Köhring?', help: 'How to contact Norman Köhring?',
message: [ message: [
'# other servers', '# other servers',

View file

@ -29,9 +29,12 @@ onMounted(() => {
return return
} }
const { addText, clear, footerLinks } = useTerminal(textArea.value, commands.value) const { addText, addLine, clear, footerLinks } = useTerminal(textArea.value, commands.value)
clear()
addText('Hello World!') watch(frontmatter, () => {
addText(title.value + '\n', false)
addLine(content.value.join('\n'))
}, { immediate: true })
watch(footerLinks, () => { watch(footerLinks, () => {
footer.value = footerLinks.value footer.value = footerLinks.value

View file

@ -20,8 +20,8 @@ export default function useTerminal(inputEl: HTMLTextAreaElement, commands: Simp
inputEl.focus() inputEl.focus()
} }
function addText(text: string) { function addText(text: string, addPrompt=true) {
const line = text + prompt const line = addPrompt ? text + prompt : text
inputEl.value = inputEl.value + line inputEl.value = inputEl.value + line
inputEl.scrollTop = inputEl.scrollTopMax inputEl.scrollTop = inputEl.scrollTopMax
} }
@ -31,6 +31,7 @@ export default function useTerminal(inputEl: HTMLTextAreaElement, commands: Simp
} }
function clear() { function clear() {
footerLinks.value = []
inputEl.value = '' inputEl.value = ''
addText('') addText('')
} }