|
1 | 1 | <script setup lang="ts"> |
2 | 2 | const { seo } = useAppConfig() |
| 3 | +const site = useSiteConfig() |
3 | 4 |
|
4 | 5 | const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('docs')) |
5 | 6 | const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSections('docs'), { |
6 | 7 | server: false |
7 | 8 | }) |
8 | 9 |
|
| 10 | +const siteUrl = site.url || 'https://vercube.dev' |
| 11 | +const siteName = seo?.siteName || 'Vercube' |
| 12 | +
|
9 | 13 | useHead({ |
10 | 14 | meta: [ |
11 | 15 | { name: 'viewport', content: 'width=device-width, initial-scale=1' } |
12 | 16 | ], |
13 | 17 | link: [ |
14 | | - { rel: 'icon', href: '/favicon.ico' } |
| 18 | + { rel: 'icon', type: 'image/png', href: '/favicon-96x96.png', sizes: '96x96' }, |
| 19 | + { rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' }, |
| 20 | + { rel: 'shortcut icon', href: '/favicon.ico' }, |
| 21 | + { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' }, |
| 22 | + { rel: 'manifest', href: '/site.webmanifest' } |
15 | 23 | ], |
16 | 24 | htmlAttrs: { |
17 | 25 | lang: 'en' |
18 | 26 | } |
19 | 27 | }) |
20 | 28 |
|
21 | 29 | useSeoMeta({ |
22 | | - titleTemplate: `%s - ${seo?.siteName}`, |
23 | | - ogSiteName: seo?.siteName, |
24 | | - twitterCard: 'summary_large_image' |
| 30 | + // Global defaults |
| 31 | + titleTemplate: `%s - ${siteName}`, |
| 32 | + ogSiteName: siteName, |
| 33 | + twitterCard: 'summary_large_image', |
| 34 | + twitterSite: '@vercubejs', |
| 35 | + twitterCreator: '@vercubejs', |
| 36 | +
|
| 37 | + // Open Graph defaults |
| 38 | + ogType: 'website', |
| 39 | + ogLocale: 'en_US', |
| 40 | + ogImage: `${siteUrl}/og-image.png`, |
| 41 | + ogImageWidth: 1200, |
| 42 | + ogImageHeight: 630, |
| 43 | +
|
| 44 | + // Application defaults |
| 45 | + applicationName: siteName, |
| 46 | + appleMobileWebAppTitle: siteName, |
| 47 | + appleMobileWebAppCapable: 'yes', |
| 48 | + appleMobileWebAppStatusBarStyle: 'black-translucent', |
| 49 | +
|
| 50 | + // Theme |
| 51 | + themeColor: '#000000', |
| 52 | + colorScheme: 'dark light', |
| 53 | +
|
| 54 | + // SEO defaults |
| 55 | + robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', |
| 56 | + author: 'Vercube Team', |
| 57 | +
|
| 58 | + // Keywords (global) |
| 59 | + keywords: [ |
| 60 | + 'vercube', |
| 61 | + 'javascript framework', |
| 62 | + 'typescript framework', |
| 63 | + 'server framework', |
| 64 | + 'node.js', |
| 65 | + 'bun', |
| 66 | + 'deno', |
| 67 | + 'dependency injection', |
| 68 | + 'decorators', |
| 69 | + 'routing', |
| 70 | + 'middleware', |
| 71 | + 'validation', |
| 72 | + 'esm', |
| 73 | + 'web-native', |
| 74 | + 'request response', |
| 75 | + 'serverless', |
| 76 | + 'api framework', |
| 77 | + 'modern javascript', |
| 78 | + 'type-safe', |
| 79 | + 'zero-config' |
| 80 | + ].join(', ') |
| 81 | +}) |
| 82 | +
|
| 83 | +// Global JSON-LD structured data |
| 84 | +useHead({ |
| 85 | + script: [ |
| 86 | + { |
| 87 | + type: 'application/ld+json', |
| 88 | + innerHTML: JSON.stringify({ |
| 89 | + '@context': 'https://schema.org', |
| 90 | + '@type': 'WebSite', |
| 91 | + 'name': 'Vercube', |
| 92 | + 'url': siteUrl, |
| 93 | + 'potentialAction': { |
| 94 | + '@type': 'SearchAction', |
| 95 | + 'target': { |
| 96 | + '@type': 'EntryPoint', |
| 97 | + 'urlTemplate': `${siteUrl}/docs?q={search_term_string}` |
| 98 | + }, |
| 99 | + 'query-input': 'required name=search_term_string' |
| 100 | + } |
| 101 | + }) |
| 102 | + }, |
| 103 | + { |
| 104 | + type: 'application/ld+json', |
| 105 | + innerHTML: JSON.stringify({ |
| 106 | + '@context': 'https://schema.org', |
| 107 | + '@type': 'SoftwareApplication', |
| 108 | + 'name': 'Vercube', |
| 109 | + 'applicationCategory': 'DeveloperApplication', |
| 110 | + 'operatingSystem': 'Node.js, Bun, Deno', |
| 111 | + 'url': siteUrl, |
| 112 | + 'author': { |
| 113 | + '@type': 'Organization', |
| 114 | + 'name': 'Vercube', |
| 115 | + 'url': 'https://github.com/vercube' |
| 116 | + }, |
| 117 | + 'offers': { |
| 118 | + '@type': 'Offer', |
| 119 | + 'price': '0', |
| 120 | + 'priceCurrency': 'USD' |
| 121 | + }, |
| 122 | + 'aggregateRating': { |
| 123 | + '@type': 'AggregateRating', |
| 124 | + 'ratingValue': '5', |
| 125 | + 'ratingCount': '1' |
| 126 | + } |
| 127 | + }) |
| 128 | + } |
| 129 | + ] |
25 | 130 | }) |
26 | 131 |
|
27 | 132 | provide('navigation', navigation) |
|
0 commit comments