feat: Add comprehensive SEO and meta tags for improved web presence
- Enhance +layout.svelte with detailed meta tags for SEO optimization - Include Open Graph and Twitter card metadata - Add language, viewport, and canonical link tags - Update +layout.ts to provide default meta information for the project - Set French language and localization attributes
- commit
- ff2a41efcbfdb228ba5d42c98824290b88d974cd
- author
- Kit · · 2025-02-17 07:03 UTC
- parent
- 53dfa50
- signature
- SSH Unverified
SHA256:H91DFuEG4jpk5edzLA4aUKkpv4zv9Q339ipRmkph6TkThe key is unknown
4 files · +40 -7
M .cursor/rules/global.mdc +1 -1
| @@ -4,7 +4,7 @@ globs: | |||
| 4 | 4 | --- | |
| 5 | 5 | # Debugging | |
| 6 | 6 | - Always add console.debug for client sided code. | |
| 7 | - | - Always add either console.log or follow the logger implementation if any server/backend code. | |
| 7 | + | - Always add either console.log or follow the logger implementation if any for server/backend code. | |
| 8 | 8 | ||
| 9 | 9 | # Language | |
| 10 | 10 | - The content of the app is in French but the code comments must be in English.⏎̸ | |
| @@ -4,7 +4,7 @@ globs: | |||||
| 4 | --- | 4 | --- | ||
| 5 | # Debugging | 5 | # Debugging | ||
| 6 | - Always add console.debug for client sided code. | 6 | - Always add console.debug for client sided code. | ||
| 7 | - | - Always add either console.log or follow the logger implementation if any server/backend code. | 7 | + | - Always add either console.log or follow the logger implementation if any for server/backend code. |
| 8 | 8 | ||||
| 9 | # Language | 9 | # Language | ||
| 10 | - The content of the app is in French but the code comments must be in English.⏎̸ | 10 | - The content of the app is in French but the code comments must be in English.⏎̸ | ||
M .cursor/rules/svelte5.mdc +0 -5
| @@ -2,11 +2,6 @@ | |||
| 2 | 2 | description: | |
| 3 | 3 | globs: | |
| 4 | 4 | --- | |
| 5 | - | cursor.directory | |
| 6 | - | Generate rule | |
| 7 | - | MCP Servers | |
| 8 | - | Learn | |
| 9 | - | ||
| 10 | 5 | You are an expert in Svelte 5, SvelteKit, TypeScript, and modern web development. | |
| 11 | 6 | ||
| 12 | 7 | Key Principles | |
| @@ -2,11 +2,6 @@ | |||||
| 2 | description: | 2 | description: | ||
| 3 | globs: | 3 | globs: | ||
| 4 | --- | 4 | --- | ||
| 5 | - | cursor.directory | |||
| 6 | - | Generate rule | |||
| 7 | - | MCP Servers | |||
| 8 | - | Learn | |||
| 9 | - | ||||
| 10 | You are an expert in Svelte 5, SvelteKit, TypeScript, and modern web development. | 5 | You are an expert in Svelte 5, SvelteKit, TypeScript, and modern web development. | ||
| 11 | 6 | ||||
| 12 | Key Principles | 7 | Key Principles | ||
M src/routes/+layout.svelte +29 -0
| @@ -222,6 +222,35 @@ | |||
| 222 | 222 | }); | |
| 223 | 223 | </script> | |
| 224 | 224 | ||
| 225 | + | <svelte:head> | |
| 226 | + | <title>{data.meta.title}</title> | |
| 227 | + | <meta name="description" content={data.meta.description} /> | |
| 228 | + | <meta name="keywords" content={data.meta.keywords} /> | |
| 229 | + | <meta name="language" content="French" /> | |
| 230 | + | <html lang="fr" /> | |
| 231 | + | ||
| 232 | + | <!-- Open Graph / Facebook --> | |
| 233 | + | <meta property="og:locale" content={data.meta.locale} /> | |
| 234 | + | <meta property="og:type" content={data.meta.type} /> | |
| 235 | + | <meta property="og:url" content={data.meta.url} /> | |
| 236 | + | <meta property="og:title" content={data.meta.title} /> | |
| 237 | + | <meta property="og:description" content={data.meta.description} /> | |
| 238 | + | <meta property="og:image" content={data.meta.ogImage} /> | |
| 239 | + | ||
| 240 | + | <!-- Twitter --> | |
| 241 | + | <meta property="twitter:card" content="summary_large_image" /> | |
| 242 | + | <meta property="twitter:url" content={data.meta.url} /> | |
| 243 | + | <meta property="twitter:title" content={data.meta.title} /> | |
| 244 | + | <meta property="twitter:description" content={data.meta.description} /> | |
| 245 | + | <meta property="twitter:image" content={data.meta.ogImage} /> | |
| 246 | + | ||
| 247 | + | <!-- Additional Meta Tags --> | |
| 248 | + | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| 249 | + | <meta name="theme-color" content="#2195f2" /> | |
| 250 | + | <link rel="canonical" href={data.meta.url} /> | |
| 251 | + | <link rel="alternate" hreflang="fr" href={data.meta.url} /> | |
| 252 | + | </svelte:head> | |
| 253 | + | ||
| 225 | 254 | <div class="windows-xp-bg"> | |
| 226 | 255 | {@render children()} | |
| 227 | 256 | </div> | |
| @@ -222,6 +222,35 @@ | |||||
| 222 | }); | 222 | }); | ||
| 223 | </script> | 223 | </script> | ||
| 224 | 224 | ||||
| 225 | + | <svelte:head> | |||
| 226 | + | <title>{data.meta.title}</title> | |||
| 227 | + | <meta name="description" content={data.meta.description} /> | |||
| 228 | + | <meta name="keywords" content={data.meta.keywords} /> | |||
| 229 | + | <meta name="language" content="French" /> | |||
| 230 | + | <html lang="fr" /> | |||
| 231 | + | ||||
| 232 | + | <!-- Open Graph / Facebook --> | |||
| 233 | + | <meta property="og:locale" content={data.meta.locale} /> | |||
| 234 | + | <meta property="og:type" content={data.meta.type} /> | |||
| 235 | + | <meta property="og:url" content={data.meta.url} /> | |||
| 236 | + | <meta property="og:title" content={data.meta.title} /> | |||
| 237 | + | <meta property="og:description" content={data.meta.description} /> | |||
| 238 | + | <meta property="og:image" content={data.meta.ogImage} /> | |||
| 239 | + | ||||
| 240 | + | <!-- Twitter --> | |||
| 241 | + | <meta property="twitter:card" content="summary_large_image" /> | |||
| 242 | + | <meta property="twitter:url" content={data.meta.url} /> | |||
| 243 | + | <meta property="twitter:title" content={data.meta.title} /> | |||
| 244 | + | <meta property="twitter:description" content={data.meta.description} /> | |||
| 245 | + | <meta property="twitter:image" content={data.meta.ogImage} /> | |||
| 246 | + | ||||
| 247 | + | <!-- Additional Meta Tags --> | |||
| 248 | + | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |||
| 249 | + | <meta name="theme-color" content="#2195f2" /> | |||
| 250 | + | <link rel="canonical" href={data.meta.url} /> | |||
| 251 | + | <link rel="alternate" hreflang="fr" href={data.meta.url} /> | |||
| 252 | + | </svelte:head> | |||
| 253 | + | ||||
| 225 | <div class="windows-xp-bg"> | 254 | <div class="windows-xp-bg"> | ||
| 226 | {@render children()} | 255 | {@render children()} | ||
| 227 | </div> | 256 | </div> | ||
M src/routes/+layout.ts +10 -1
| @@ -22,6 +22,15 @@ export const load: LayoutLoad = async ({ data, depends }) => { | |||
| 22 | 22 | // Return the data from the server load function | |
| 23 | 23 | return { | |
| 24 | 24 | user: data.user, | |
| 25 | - | session: data.session | |
| 25 | + | session: data.session, | |
| 26 | + | meta: { | |
| 27 | + | title: 'PDR AIM - Sandbox', | |
| 28 | + | description: 'Un projet sandbox non lucratif qui recrée l\'ambiance des salons de discussion de l\'époque AOL/AIM. Une expérience nostalgique dans un environnement Windows XP.', | |
| 29 | + | keywords: 'sandbox chat, AOL, AIM, salon de discussion, Windows XP, projet non lucratif, rétro', | |
| 30 | + | ogImage: '/og-image.jpg', | |
| 31 | + | type: 'website', | |
| 32 | + | url: 'https://pdraim.org', | |
| 33 | + | locale: 'fr_FR' | |
| 34 | + | } | |
| 26 | 35 | }; | |
| 27 | 36 | }; ⏎̸ | |
| @@ -22,6 +22,15 @@ export const load: LayoutLoad = async ({ data, depends }) => { | |||||
| 22 | // Return the data from the server load function | 22 | // Return the data from the server load function | ||
| 23 | return { | 23 | return { | ||
| 24 | user: data.user, | 24 | user: data.user, | ||
| 25 | - | session: data.session | 25 | + | session: data.session, |
| 26 | + | meta: { | |||
| 27 | + | title: 'PDR AIM - Sandbox', | |||
| 28 | + | description: 'Un projet sandbox non lucratif qui recrée l\'ambiance des salons de discussion de l\'époque AOL/AIM. Une expérience nostalgique dans un environnement Windows XP.', | |||
| 29 | + | keywords: 'sandbox chat, AOL, AIM, salon de discussion, Windows XP, projet non lucratif, rétro', | |||
| 30 | + | ogImage: '/og-image.jpg', | |||
| 31 | + | type: 'website', | |||
| 32 | + | url: 'https://pdraim.org', | |||
| 33 | + | locale: 'fr_FR' | |||
| 34 | + | } | |||
| 26 | }; | 35 | }; | ||
| 27 | }; ⏎̸ | 36 | }; ⏎̸ | ||