feat: tab title same as breadcrumb
This commit is contained in:
committed by
Julien Calixte
parent
c715980baa
commit
9768c08692
@@ -15,6 +15,7 @@ import { computed, nextTick, watch } from "vue"
|
|||||||
import { useRouter } from "vue-router"
|
import { useRouter } from "vue-router"
|
||||||
import { useResizeContainer } from "@/hooks/useResizeContainer.hook"
|
import { useResizeContainer } from "@/hooks/useResizeContainer.hook"
|
||||||
import ThemeSwap from "@/components/ThemeSwap.vue"
|
import ThemeSwap from "@/components/ThemeSwap.vue"
|
||||||
|
import { useTitle } from "@vueuse/core"
|
||||||
|
|
||||||
const props = defineProps<{ did: string; rkey: string; slug?: string }>()
|
const props = defineProps<{ did: string; rkey: string; slug?: string }>()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -70,6 +71,16 @@ const content = computed(() =>
|
|||||||
: "",
|
: "",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const breadcrumb = computed(() =>
|
||||||
|
title.value
|
||||||
|
? author.value?.handle
|
||||||
|
? `${title.value} • ${author.value.handle}`
|
||||||
|
: title.value
|
||||||
|
: `Remanso`,
|
||||||
|
)
|
||||||
|
|
||||||
|
useTitle(breadcrumb)
|
||||||
|
|
||||||
const publishedAt = computed(() =>
|
const publishedAt = computed(() =>
|
||||||
noteRecord.value?.value.publishedAt
|
noteRecord.value?.value.publishedAt
|
||||||
? new Date(noteRecord.value?.value.publishedAt).toLocaleDateString()
|
? new Date(noteRecord.value?.value.publishedAt).toLocaleDateString()
|
||||||
@@ -121,8 +132,8 @@ watch(
|
|||||||
<a
|
<a
|
||||||
class="title-stacked-note-link"
|
class="title-stacked-note-link"
|
||||||
@click.prevent="scrollToFocusedNote()"
|
@click.prevent="scrollToFocusedNote()"
|
||||||
v-if="author && title"
|
v-if="breadcrumb"
|
||||||
>{{ author.handle }} • {{ title }}</a
|
>{{ breadcrumb }}</a
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user