This commit introduces significant SEO improvements and enhances content embedding capabilities. - Integrates `@nuxtjs/seo`, `@nuxtjs/sitemap`, and `@nuxtjs/robots` to boost search engine visibility. - Configures global meta tags, including Open Graph and Twitter Cards, for richer social media sharing. - Adds support for embedding YouTube and Facebook content directly within markdown pages. - Introduces a new `TikTokEmbed` component for future use.
27 lines
739 B
Vue
27 lines
739 B
Vue
<script setup lang="ts">
|
|
import { onMounted } from "vue";
|
|
|
|
const props = defineProps<{
|
|
url: string
|
|
}>()
|
|
|
|
onMounted(() => {
|
|
// 如果 TikTok embed 脚本未加载,动态注入
|
|
if (!document.querySelector('script[src="https://www.tiktok.com/embed.js"]')) {
|
|
const s = document.createElement("script");
|
|
s.src = "https://www.tiktok.com/embed.js";
|
|
s.async = true;
|
|
document.body.appendChild(s);
|
|
} else {
|
|
// 如果脚本已存在,调用它刷新 embed
|
|
// 官方脚本会自动处理,不需要手动 init
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<blockquote class="tiktok-embed" :cite="url" data-video-id="" style="max-width: 605px; min-width: 325px;">
|
|
<a :href="url">View on TikTok</a>
|
|
</blockquote>
|
|
</template>
|