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>
|
||||
@@ -44,6 +44,16 @@ cover: "/events/20250927-return-to-school/event-photo-1.jpg"
|
||||
|
||||
---
|
||||
|
||||
<iframe
|
||||
src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fstory.php%3Fstory_fbid%3D10163303061049019%26id%3D667519018"
|
||||
class="w-full"
|
||||
height="720"
|
||||
scrolling="no"
|
||||
frameborder="0"
|
||||
allowfullscreen="true"
|
||||
allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share">
|
||||
</iframe>
|
||||
|
||||
# 午宴 • 征信录
|
||||
|
||||
## 乐捐名单
|
||||
|
||||
@@ -7,11 +7,14 @@ gallery:
|
||||
[
|
||||
"/hall-of-fame/he-si-rong/采访照 1.jpg",
|
||||
"/hall-of-fame/he-si-rong/采访照 2.webp",
|
||||
"/hall-of-fame/he-si-rong/作品 1.webp"
|
||||
"/hall-of-fame/he-si-rong/作品 1.webp",
|
||||
]
|
||||
---
|
||||
|
||||
# 何四荣学长
|
||||
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/Nu50FOvrGhI?si=Bq06-PFEfAhS4pvE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
||||
|
||||
## 基本背景
|
||||
|
||||
何四荣学长出生并成长于柔佛州永平,系永平中学 1974 年届(第九届)毕业生,之后赴吉隆坡深造艺术相关学业。作为家乡出身的艺术家,他长期活跃于本地与区域艺术圈,並多次受邀参与校内外的艺术活动与联展。([vtour.my](https://vtour.my/local-artist-%E6%9C%AC%E5%9C%9F%E7%94%BB%E5%AE%B6/?utm_source=chatgpt.com "Local artist 本土画家| VTOUR"))
|
||||
|
||||
@@ -3,8 +3,11 @@ name: "马文清学长"
|
||||
photo: "/hall-of-fame/ma-wong-ching/马文清学长.png"
|
||||
title: "俐马集团董事长、永平中学董事长"
|
||||
---
|
||||
|
||||
# 马文清学长
|
||||
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/PWcWdJsADAY?si=S73q0jvCZkWrIAAt" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
||||
|
||||
**马文清(1951年生,马来西亚柔佛州永平人)**
|
||||
|
||||
现任 **俐马集团(Ramatex Berhad)董事长** 、 **永平中学董事长** 。
|
||||
@@ -17,8 +20,8 @@ title: "俐马集团董事长、永平中学董事长"
|
||||
|
||||
凭借其对产业、教育与社会的卓越贡献,马文清校友荣获:
|
||||
|
||||
* **逢甲大学第五届杰出校友(2003年)**
|
||||
* **逢甲大学荣誉博士学位(2023年,第8位获此荣衔校友)**
|
||||
* **2025全球杰出僑生校友 企业工商奖**
|
||||
- **逢甲大学第五届杰出校友(2003年)**
|
||||
- **逢甲大学荣誉博士学位(2023年,第8位获此荣衔校友)**
|
||||
- **2025全球杰出僑生校友 企业工商奖**
|
||||
|
||||
马文清校友以企业家的远见、教育家的情怀与社会责任感,书写了跨越产业与公益的荣耀篇章,堪为永中人之典范。
|
||||
|
||||
@@ -4,13 +4,22 @@ import tailwindcss from "@tailwindcss/vite";
|
||||
export default defineNuxtConfig({
|
||||
compatibilityDate: "2025-07-15",
|
||||
devtools: { enabled: true },
|
||||
modules: ["@nuxt/content", "@nuxt/image", "@nuxt/ui", "reka-ui/nuxt"],
|
||||
modules: [
|
||||
"@nuxt/content",
|
||||
"@nuxt/image",
|
||||
"@nuxt/ui",
|
||||
"reka-ui/nuxt",
|
||||
"@nuxtjs/robots",
|
||||
"@nuxtjs/seo",
|
||||
"@nuxtjs/sitemap",
|
||||
],
|
||||
css: ["~/assets/css/main.css"],
|
||||
vite: {
|
||||
plugins: [tailwindcss()],
|
||||
},
|
||||
app: {
|
||||
head: {
|
||||
titleTemplate: "%s - 永平中学校友会",
|
||||
title: "永平中学校友会",
|
||||
script: [
|
||||
{
|
||||
@@ -18,6 +27,30 @@ export default defineNuxtConfig({
|
||||
tagPosition: "head",
|
||||
},
|
||||
],
|
||||
meta: [
|
||||
// 基础 SEO
|
||||
{ name: "description", content: "永平中学校友会官网 - 连接校友,共享资源,传承母校精神。" },
|
||||
{ name: "keywords", content: "永平中学, 校友会, 永平中学校友, 永平校友, 同学会" },
|
||||
{ name: "author", content: "永平中学校友会" },
|
||||
{ name: "viewport", content: "width=device-width, initial-scale=1" },
|
||||
|
||||
// Open Graph(Facebook/LinkedIn)
|
||||
{ property: "og:title", content: "永平中学校友会" },
|
||||
{ property: "og:description", content: "永平中学校友会官网 - 连接校友,共享资源,传承母校精神。" },
|
||||
{ property: "og:type", content: "website" },
|
||||
{ property: "og:url", content: "https://yphsalumni.org" }, // ✅ 换成你网站的真实域名
|
||||
{ property: "og:image", content: "https://yphsalumni.org/hero-image.jpg" }, // ✅ 上传一张封面图
|
||||
|
||||
// Twitter Card
|
||||
{ name: "twitter:card", content: "summary_large_image" },
|
||||
{ name: "twitter:title", content: "永平中学校友会" },
|
||||
{ name: "twitter:description", content: "连接校友,共享资源,传承母校精神。" },
|
||||
{ name: "twitter:image", content: "https://yphsalumni.org/hero-image.jpg" },
|
||||
],
|
||||
},
|
||||
},
|
||||
site: {
|
||||
url: "https://yphsalumni.com",
|
||||
name: "永中校友会 YPHS Alumni"
|
||||
}
|
||||
});
|
||||
@@ -13,6 +13,9 @@
|
||||
"@nuxt/content": "3.7.1",
|
||||
"@nuxt/image": "1.11.0",
|
||||
"@nuxt/ui": "4.0.0",
|
||||
"@nuxtjs/robots": "5.5.5",
|
||||
"@nuxtjs/seo": "3.2.2",
|
||||
"@nuxtjs/sitemap": "7.4.7",
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"better-sqlite3": "^12.4.1",
|
||||
"element-plus": "^2.11.4",
|
||||
|
||||
936
pnpm-lock.yaml
generated
936
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user