feat(seo): implement SEO enhancements and social media embeds
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.
This commit is contained in:
26
app/components/TikTokEmbed.vue
Normal file
26
app/components/TikTokEmbed.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user