Skip to content

Commit 0027946

Browse files
committed
Add embed data for OpenGraph and Twitter
1 parent 6e1516e commit 0027946

File tree

5 files changed

+48
-3
lines changed

5 files changed

+48
-3
lines changed

app.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@
2121
const route = useRoute();
2222
2323
useHead({
24-
titleTemplate: '%s - Unity Multiplayer'
24+
titleTemplate: '%s - Unity Multiplayer',
25+
meta: [
26+
{
27+
property: 'og:title',
28+
content: `${route.meta.name} - Unity Multiplayer`
29+
},
30+
{
31+
property: 'twitter:title',
32+
content: `${route.meta.name} - Unity Multiplayer`
33+
},
34+
{
35+
property: 'title',
36+
content: `${route.meta.name} - Unity Multiplayer`
37+
}
38+
]
2539
});
2640
</script>

nuxt.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const description = 'Unity Multiplayer is a multilingual factions Minecraft server for creators, which also features the first free and public live translation mod UnityTranslate.';
2+
13
// https://nuxt.com/docs/api/configuration/nuxt-config
24
export default defineNuxtConfig({
35
compatibilityDate: '2024-11-01',
@@ -13,6 +15,17 @@ export default defineNuxtConfig({
1315
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,1,0' },
1416
{ rel: 'icon', href: '/icon.svg' }
1517
],
18+
meta: [
19+
{ name: 'description', content: description },
20+
{ name: 'og:type', content: 'website' },
21+
{ name: 'og:description', content: description },
22+
{ name: 'og:url', content: 'https://unitymultiplayer.online' },
23+
{ name: 'og:image', content: 'https://unitymultiplayer.online/icon.svg' },
24+
{ name: 'twitter:description', content: description },
25+
{ name: 'twitter:url', content: 'https://unitymultiplayer.online' },
26+
{ name: 'twitter:card', content: 'summary' },
27+
{ name: 'twitter:image', content: 'https://unitymultiplayer.online/icon.svg' },
28+
]
1629
},
1730
},
1831
});

pages/about.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,10 @@
1717
all running on Fabric 1.21.1, created by BluSpring and TheFox580.
1818
</p>
1919
</main>
20-
</template>
20+
</template>
21+
22+
<script setup lang="ts">
23+
definePageMeta({
24+
name: 'About'
25+
});
26+
</script>

pages/credits.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,10 @@ a {
5959
a:hover {
6060
filter: brightness(125%);
6161
}
62-
</style>
62+
</style>
63+
64+
<script setup lang="ts">
65+
definePageMeta({
66+
name: 'Credits'
67+
});
68+
</script>

pages/index.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,10 @@
6060
};
6161
}
6262
}
63+
</script>
64+
65+
<script setup lang="ts">
66+
definePageMeta({
67+
name: 'Home'
68+
});
6369
</script>

0 commit comments

Comments
 (0)