|
12 | 12 | } |
13 | 13 |
|
14 | 14 | const { children, data } = $props() |
| 15 | + const siteUrl = 'https://animated-java.github.io' |
| 16 | + const docsTitle = 'Animated Java Docs' |
| 17 | + const defaultDescription = 'Effortlessly craft complex animations for Minecraft: Java Edition' |
| 18 | + const socialImage = `${siteUrl}/images/armor_stand_wave.webp` |
| 19 | +
|
| 20 | + const pageTitle = $derived( |
| 21 | + data.currentDoc?.title ? `${data.currentDoc.title} | ${docsTitle}` : docsTitle |
| 22 | + ) |
| 23 | + const pageDescription = $derived( |
| 24 | + data.currentDoc?.title ? `${data.currentDoc.title}` : defaultDescription |
| 25 | + ) |
| 26 | + const canonicalUrl = $derived(`${siteUrl}${data.currentPath ?? '/docs/welcome'}`) |
15 | 27 |
|
16 | 28 | let tocHeadings = $state<TocHeading[]>([]) |
17 | 29 | let activeHeadingId = $state('') |
|
169 | 181 | }) |
170 | 182 | </script> |
171 | 183 |
|
| 184 | +<svelte:head> |
| 185 | + <title>{pageTitle}</title> |
| 186 | + <meta name="description" content={pageDescription} /> |
| 187 | + <link rel="canonical" href={canonicalUrl} /> |
| 188 | + |
| 189 | + <meta property="og:type" content="website" /> |
| 190 | + <meta property="og:site_name" content="Animated Java" /> |
| 191 | + <meta property="og:title" content={pageTitle} /> |
| 192 | + <meta property="og:description" content={pageDescription} /> |
| 193 | + <meta property="og:url" content={canonicalUrl} /> |
| 194 | + <meta property="og:image" content={socialImage} /> |
| 195 | + |
| 196 | + <meta name="twitter:card" content="summary_large_image" /> |
| 197 | + <meta name="twitter:title" content={pageTitle} /> |
| 198 | + <meta name="twitter:description" content={pageDescription} /> |
| 199 | + <meta name="twitter:image" content={socialImage} /> |
| 200 | +</svelte:head> |
| 201 | + |
172 | 202 | <div class="docs-shell"> |
173 | 203 | <header class="docs-header minecraft-box"> |
174 | 204 | <a href="/" class="brand-link"> |
|
0 commit comments