Embed widgets

This commit is contained in:
2024-08-17 01:33:16 +08:00
parent 58ad9996cd
commit 21a02689dd
14 changed files with 403 additions and 20 deletions

View File

@ -0,0 +1,39 @@
<template>
<div>
<div class="my-3" v-if="!route.query['no-title']">
<h1 class="text-2xl">{{ route.query["title"] ?? t("navPosts") }}</h1>
<span>{{ route.query["caption"] ?? t("navPostsCaptionWithRealm", [`#${route.params.id}`]) }}</span>
</div>
<post-list class="mx-[-2.5ch]" :realm-id="parseInt(route.params.id?.toString())" />
</div>
</template>
<script setup lang="ts">
definePageMeta({
layout: "embed",
})
const { t } = useI18n()
const route = useRoute()
if(Number.isNaN(parseInt(route.params.id?.toString()))) {
throw createError({
statusCode: 400,
statusMessage: "Realm ID must be a Number",
})
}
useHead({
title: t("navPosts"),
})
useSeoMeta({
title: t("navPosts"),
ogTitle: t("navPosts"),
description: t("navPostsCaption"),
ogDescription: t("navPostsCaption"),
ogType: "website",
})
</script>