Update page title

This commit is contained in:
Marcel Hellkamp 2023-07-27 17:36:50 +02:00
parent 3c65cfdd6c
commit 2c6d99e8ec

View File

@ -4,7 +4,7 @@ import { useDocumentVisibility, usePreferredDark, useWindowSize, watchDebounced
import { type Config, type Post } from '@/types'; import { type Config, type Post } from '@/types';
import { loadConfig } from '@/config'; import { loadConfig } from '@/config';
import { gitVersion } from '@/defaults' import { fallbackConfig, gitVersion } from '@/defaults'
import { fetchPosts } from '@/sources' import { fetchPosts } from '@/sources'
import Card from './components/Card.vue'; import Card from './components/Card.vue';
@ -59,6 +59,9 @@ watch(actualTheme, () => {
document.body!.parentElement!.dataset.bsTheme = actualTheme.value document.body!.parentElement!.dataset.bsTheme = actualTheme.value
}) })
// Update page title
watch(() => config.value?.title, () => document.title = config.value?.title || fallbackConfig.title)
// Watch for a update interval changes // Watch for a update interval changes
watch(() => config.value?.interval, () => restartUpdates()) watch(() => config.value?.interval, () => restartUpdates())