feat: SEO complet + analytics Umami + og:image § logo
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
SEO : - composable useSeoPage() : og:*, Twitter Cards, canonical sur toutes les pages (15 pages) - app.vue : JSON-LD Organization + Book, og:image global og-default.png - og-default.png 1200×630 : logo § calligraphique + texte (Pillow) - nuxt.config.ts : @nuxtjs/sitemap avec 26 URLs statiques Analytics Umami : - useTracking() : helpers typés audio/pdf/player/scroll/cta - useScrollTracking() : scroll depth 25/50/75/100% + liens externes auto - useAudioPlayer : trackAudioPlay/Progress/Complete - BookPdfReader : trackPdfOpen/Close avec durée - BookPlayer : trackPlayerOpen/Chapter/Mode - docker-compose : variables NUXT_PUBLIC_UMAMI_* passées au container Images : - Couv-Economie-du-don.jpg ajoutée dans public/images/ - bookplayer.config.yml + home.yml : références mises à jour Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* Applique toutes les balises SEO (og:*, Twitter Cards, canonical, description)
|
||||
* à partir du contenu YAML d'une page.
|
||||
*
|
||||
* Usage dans les pages :
|
||||
* useSeoPage({ title: content.value?.meta?.title, description: content.value?.description })
|
||||
*
|
||||
* L'og:image par défaut est /og-default.png (logo §).
|
||||
* Chaque section peut surcharger avec son propre image via le champ seo.image du YAML.
|
||||
*/
|
||||
export function useSeoPage(opts: {
|
||||
title?: string | null
|
||||
description?: string | null
|
||||
image?: string | null
|
||||
type?: 'website' | 'article' | 'book'
|
||||
}) {
|
||||
const config = useRuntimeConfig()
|
||||
const route = useRoute()
|
||||
const siteUrl = (config.public.siteUrl as string) || 'https://librodrome.org'
|
||||
|
||||
const title = opts.title || 'Le Librodrome'
|
||||
const description = opts.description
|
||||
|| 'Autonomie numérique, économique et citoyenne. Un livre et des chansons sur l\'économie du don.'
|
||||
const rawImage = opts.image || '/og-default.png'
|
||||
const image = rawImage.startsWith('http') ? rawImage : `${siteUrl}${rawImage}`
|
||||
const canonical = `${siteUrl}${route.path}`
|
||||
const type = opts.type || 'website'
|
||||
|
||||
useSeoMeta({
|
||||
// Open Graph
|
||||
ogTitle: title,
|
||||
ogDescription: description,
|
||||
ogImage: image,
|
||||
ogImageWidth: 1200,
|
||||
ogImageHeight: 630,
|
||||
ogUrl: canonical,
|
||||
ogType: type,
|
||||
ogSiteName: 'Le Librodrome',
|
||||
ogLocale: 'fr_FR',
|
||||
// Twitter Cards
|
||||
twitterCard: 'summary_large_image',
|
||||
twitterTitle: title,
|
||||
twitterDescription: description,
|
||||
twitterImage: image,
|
||||
// Standard
|
||||
description,
|
||||
})
|
||||
|
||||
useHead({
|
||||
link: [{ rel: 'canonical', href: canonical }],
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user