feat: add title for pages

main
三咲智子 2022-11-25 19:48:48 +08:00
parent dfdf95da61
commit f54e135848
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
10 changed files with 39 additions and 2 deletions

View File

@ -2,7 +2,7 @@
import { APP_NAME } from './constants'
useHead({
title: APP_NAME,
titleTemplate: title => `${title ? `${title} | ` : ''}${APP_NAME}${import.meta.env.DEV ? ' (dev)' : ''}`,
link: [
{
rel: 'icon', type: 'image/svg+png', href: '/favicon.png',

View File

@ -3,6 +3,12 @@ const params = useRoute().params
const accountName = $computed(() => params.account as string)
const account = await fetchAccountByName(accountName).catch(() => null)
if (account) {
useHead({
title: `${account.displayName} (@${account.acct})`,
})
}
</script>
<template>

View File

@ -4,6 +4,10 @@ definePageMeta({
})
const paginator = masto.bookmarks.getIterator()
useHead({
title: 'Bookmarks',
})
</script>
<template>

View File

@ -4,6 +4,10 @@ definePageMeta({
})
const paginator = masto.conversations.getIterator()
useHead({
title: 'Conversations',
})
</script>
<template>

View File

@ -1,5 +1,9 @@
<script setup lang="ts">
const paginator = masto.trends.getStatuses()
useHead({
title: 'Explore',
})
</script>
<template>

View File

@ -4,6 +4,10 @@ definePageMeta({
})
const paginator = masto.favourites.getIterator()
useHead({
title: 'Favourites',
})
</script>
<template>

View File

@ -11,6 +11,10 @@ const tab = $(useLocalStorage<typeof tabNames[number]>(STORAGE_KEY_NOTIFY_TAB, '
const paginator = $computed(() => {
return masto.notifications.getIterator(tab === 'All' ? undefined : { types: ['mention'] })
})
useHead({
title: 'Notifications',
})
</script>
<template>

View File

@ -1,6 +1,9 @@
<script setup lang="ts">
const paginator = masto.timelines.getPublicIterable()
useHead({
title: 'Federated'
})
</script>
<template>

View File

@ -1,5 +1,9 @@
<script setup lang="ts">
const { data: timelines } = await useAsyncData('timelines-home', () => masto.timelines.fetchPublic({ local: true }).then(r => r.value))
useHead({
title: 'Local'
})
</script>
<template>

View File

@ -3,6 +3,10 @@ const params = useRoute().params
const tag = $computed(() => params.tag as string)
const paginator = masto.timelines.getHashtagIterable(tag)
useHead({
title: `#${tag}`,
})
</script>
<template>