From f54e1358487efca1fee84476d0c95d25547a8298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Fri, 25 Nov 2022 19:48:48 +0800 Subject: [PATCH] feat: add title for pages --- app.vue | 2 +- pages/@[account].vue | 6 ++++++ pages/bookmarks.vue | 4 ++++ pages/conversations.vue | 4 ++++ pages/explore.vue | 4 ++++ pages/favourites.vue | 4 ++++ pages/notifications.vue | 4 ++++ pages/public/index.vue | 5 ++++- pages/public/local.vue | 4 ++++ pages/tags/[tag].vue | 4 ++++ 10 files changed, 39 insertions(+), 2 deletions(-) diff --git a/app.vue b/app.vue index 359c982c..796a8125 100644 --- a/app.vue +++ b/app.vue @@ -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', diff --git a/pages/@[account].vue b/pages/@[account].vue index 8bc1ef27..5ab8f312 100644 --- a/pages/@[account].vue +++ b/pages/@[account].vue @@ -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})`, + }) +}