Skip to content

Commit

Permalink
Add meta tags for Twitter
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobefu committed May 12, 2024
1 parent 3724ba8 commit cb1aead
Show file tree
Hide file tree
Showing 9 changed files with 336 additions and 548 deletions.
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion frontend/base/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ useHead({
},
],
link: [
{
rel: 'icon',
type: 'image/x-icon',
href: '/favicon.ico',
},
{
rel: 'manifest',
href: '/manifest.json',
Expand All @@ -45,6 +50,14 @@ async function onBeforeEnter() {
}
defineOgImageComponent('LayoutOgImage')
const route = useRoute()
useSeoMeta({
ogImage: `${config.public.baseUrl}/__og-image__/image${route.path}/og.png`,
twitterImage: `${config.public.baseUrl}/__og-image__/image${route.path}/og.png`,
twitterCard: 'summary_large_image',
})
</script>

<template>
Expand All @@ -65,6 +78,6 @@ defineOgImageComponent('LayoutOgImage')
}"
/>

<LazyToastContainer />
<ToastContainer />
</NuxtLayout>
</template>
2 changes: 1 addition & 1 deletion frontend/base/components/layout/LayoutOgImage.server.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const config = useRuntimeConfig()

<template>
<div class="w-full h-full px-12 text-2xl">
<div class="flex items-center gap-4 py-8 mb-12 border-b border-gray-200">
<div class="flex flex-row items-center gap-4 py-8 mb-12 border-b border-gray-200">
<img
src="/logo-512.png"
height="96px"
Expand Down
5 changes: 0 additions & 5 deletions frontend/base/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ export default defineNuxtConfig({
},

nitro: {
compressPublicAssets: {
gzip: true,
brotli: true,
},
minify: true,
storage: {
cacheData: {
driver: 'lruCache',
Expand Down
5 changes: 5 additions & 0 deletions frontend/base/pages/user/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ useHead({
},
],
})
useSeoMeta({
twitterTitle: t('login'),
twitterDescription: t('login'),
})
</script>

<template>
Expand Down
5 changes: 5 additions & 0 deletions frontend/base/pages/user/register/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ useHead({
},
],
})
useSeoMeta({
twitterTitle: t('register'),
twitterDescription: t('register'),
})
</script>

<template>
Expand Down
Loading

0 comments on commit cb1aead

Please sign in to comment.