@indaco/sveo 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +207 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/metadata/PageMetaTags.svelte +19 -0
- package/dist/components/metadata/PageMetaTags.svelte.d.ts +7 -0
- package/dist/components/metadata/index.d.ts +3 -0
- package/dist/components/metadata/index.js +3 -0
- package/dist/components/metadata/opengraph/OpenGraph.svelte +54 -0
- package/dist/components/metadata/opengraph/OpenGraph.svelte.d.ts +7 -0
- package/dist/components/metadata/opengraph/article.svelte +29 -0
- package/dist/components/metadata/opengraph/article.svelte.d.ts +7 -0
- package/dist/components/metadata/opengraph/book.svelte +22 -0
- package/dist/components/metadata/opengraph/book.svelte.d.ts +7 -0
- package/dist/components/metadata/opengraph/business.svelte +29 -0
- package/dist/components/metadata/opengraph/business.svelte.d.ts +7 -0
- package/dist/components/metadata/opengraph/index.d.ts +1 -0
- package/dist/components/metadata/opengraph/index.js +1 -0
- package/dist/components/metadata/opengraph/music-album.svelte +34 -0
- package/dist/components/metadata/opengraph/music-album.svelte.d.ts +7 -0
- package/dist/components/metadata/opengraph/music-playlist.svelte +19 -0
- package/dist/components/metadata/opengraph/music-playlist.svelte.d.ts +7 -0
- package/dist/components/metadata/opengraph/music-radio-station.svelte +7 -0
- package/dist/components/metadata/opengraph/music-radio-station.svelte.d.ts +7 -0
- package/dist/components/metadata/opengraph/music-song.svelte +31 -0
- package/dist/components/metadata/opengraph/music-song.svelte.d.ts +7 -0
- package/dist/components/metadata/opengraph/product.svelte +15 -0
- package/dist/components/metadata/opengraph/product.svelte.d.ts +7 -0
- package/dist/components/metadata/opengraph/profile.svelte +19 -0
- package/dist/components/metadata/opengraph/profile.svelte.d.ts +7 -0
- package/dist/components/metadata/opengraph/video-episode.svelte +47 -0
- package/dist/components/metadata/opengraph/video-episode.svelte.d.ts +7 -0
- package/dist/components/metadata/opengraph/video-movie.svelte +43 -0
- package/dist/components/metadata/opengraph/video-movie.svelte.d.ts +7 -0
- package/dist/components/metadata/twittercard/TwitterCard.svelte +37 -0
- package/dist/components/metadata/twittercard/TwitterCard.svelte.d.ts +7 -0
- package/dist/components/metadata/twittercard/index.d.ts +1 -0
- package/dist/components/metadata/twittercard/index.js +1 -0
- package/dist/components/schemaorg/breadcrumbs/JsonLdBreadcrumbs.svelte +30 -0
- package/dist/components/schemaorg/breadcrumbs/JsonLdBreadcrumbs.svelte.d.ts +6 -0
- package/dist/components/schemaorg/breadcrumbs/index.d.ts +1 -0
- package/dist/components/schemaorg/breadcrumbs/index.js +1 -0
- package/dist/components/schemaorg/index.d.ts +4 -0
- package/dist/components/schemaorg/index.js +4 -0
- package/dist/components/schemaorg/sitenavigationelements/JsonLdSiteNavigationElements.svelte +22 -0
- package/dist/components/schemaorg/sitenavigationelements/JsonLdSiteNavigationElements.svelte.d.ts +8 -0
- package/dist/components/schemaorg/sitenavigationelements/index.d.ts +1 -0
- package/dist/components/schemaorg/sitenavigationelements/index.js +1 -0
- package/dist/components/schemaorg/webpage/JsonLdWebPage.svelte +17 -0
- package/dist/components/schemaorg/webpage/JsonLdWebPage.svelte.d.ts +7 -0
- package/dist/components/schemaorg/webpage/index.d.ts +1 -0
- package/dist/components/schemaorg/webpage/index.js +1 -0
- package/dist/components/schemaorg/website/JsonLdWebSite.svelte +50 -0
- package/dist/components/schemaorg/website/JsonLdWebSite.svelte.d.ts +7 -0
- package/dist/components/schemaorg/website/index.d.ts +1 -0
- package/dist/components/schemaorg/website/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types.d.ts +231 -0
- package/dist/types.js +79 -0
- package/dist/utils.d.ts +7 -0
- package/dist/utils.js +19 -0
- package/package.json +243 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 indaco (Mirco Veltri)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
|
|
2
|
+
<h1 align="center">sveo</h1>
|
|
3
|
+
<h2 align="center" style="font-size: 1.5em;">SEO made simple for Svelte & SvelteKit.</h2>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/indaco/sveo/actions/workflows/ci.yml" target="_blank">
|
|
7
|
+
<img src="https://github.com/indaco/sveo/actions/workflows/ci.yml/badge.svg" alt="CI" />
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://codecov.io/gh/indaco/sveo">
|
|
10
|
+
<img src="https://codecov.io/gh/indaco/sveo/branch/main/graph/badge.svg" alt="Codecov" />
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@indaco/sveo" target="_blank">
|
|
13
|
+
<img src="https://img.shields.io/npm/v/@indaco/sveo.svg?style=flat-square" alt="npm version" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://github.com/indaco/sveo/blob/main/LICENSE" target="_blank">
|
|
16
|
+
<img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License: MIT" />
|
|
17
|
+
</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
## Overview
|
|
21
|
+
|
|
22
|
+
**@indaco/sveo** is a collection of type-safe SEO components for [Svelte v5](https://svelte.dev) and [SvelteKit](https://kit.svelte.dev). It provides a simple and declarative way to manage SEO and metadata using components.
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
- Type-safe SEO components
|
|
27
|
+
- Works with both Svelte and SvelteKit
|
|
28
|
+
- Supports all major SEO standards:
|
|
29
|
+
- Open Graph (Facebook, LinkedIn, etc.)
|
|
30
|
+
- Twitter Cards
|
|
31
|
+
- Schema.org JSON-LD
|
|
32
|
+
- Standard meta tags
|
|
33
|
+
- Fully tree-shakable and modular
|
|
34
|
+
- No runtime JavaScript – All components render static tags inside <svelte:head>, so nothing is shipped to the client.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# pnpm
|
|
40
|
+
pnpm add -D @indaco/sveo
|
|
41
|
+
|
|
42
|
+
# npm
|
|
43
|
+
npm install --save-dev @indaco/sveo
|
|
44
|
+
|
|
45
|
+
# yarn
|
|
46
|
+
yarn add --dev @indaco/sveo
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Components List
|
|
50
|
+
|
|
51
|
+
### Metadata
|
|
52
|
+
|
|
53
|
+
Start with [`PageMetaTags`] for essential metadata like `<title>`, `<meta name="description">`, and other common tags that support SEO and social previews.
|
|
54
|
+
|
|
55
|
+
- [PageMetaTags] – A lightweight component to manage basic metadata inside `<svelte:head>`.
|
|
56
|
+
|
|
57
|
+
#### OpenGraph
|
|
58
|
+
|
|
59
|
+
Enhance your content's visibility on platforms like Facebook, LinkedIn, and others with modular components that map to Open Graph's `og:type`. Each component is designed to be composable and type-safe.
|
|
60
|
+
|
|
61
|
+
Available types:
|
|
62
|
+
|
|
63
|
+
- Article
|
|
64
|
+
- Book
|
|
65
|
+
- Business
|
|
66
|
+
- Profile
|
|
67
|
+
- Product
|
|
68
|
+
- MusicSong
|
|
69
|
+
- MusicAlbum
|
|
70
|
+
- MusicPlaylist
|
|
71
|
+
- MusicRadioStation
|
|
72
|
+
- VideoMovie
|
|
73
|
+
- VideoEpisode
|
|
74
|
+
|
|
75
|
+
Each component renders relevant `<meta property="og:*">` tags automatically based on the data you provide.
|
|
76
|
+
|
|
77
|
+
[Learn how to use the OpenGraph component](src/lib/components/metadata/opengraph/README.md)
|
|
78
|
+
|
|
79
|
+
#### TwitterCard
|
|
80
|
+
|
|
81
|
+
A flexible component that generates meta tags for [Twitter Cards](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup) using a single prop: `data`, typed as `SEOWebPage`.
|
|
82
|
+
|
|
83
|
+
It supports all official Twitter Card types:
|
|
84
|
+
|
|
85
|
+
- `summary`
|
|
86
|
+
- `summary_large_image`
|
|
87
|
+
- `player`
|
|
88
|
+
- `app`
|
|
89
|
+
|
|
90
|
+
The component automatically renders conditional tags based on the selected card type and the fields present in `data.twitter`.
|
|
91
|
+
|
|
92
|
+
[Learn how to use the TwitterCard component](src/lib/components/metadata/twittercard/README.md)
|
|
93
|
+
|
|
94
|
+
### SchemaOrg (JSON-LD)
|
|
95
|
+
|
|
96
|
+
Leverage structured data with ready-to-use components for common [Schema.org](https://schema.org/) types. These components help improve search engine understanding and support rich results in platforms like Google, Bing, and social media.
|
|
97
|
+
|
|
98
|
+
Each component accepts a simple, type-safe data object and renders a `<script type="application/ld+json">` block safely within `<svelte:head>`.
|
|
99
|
+
|
|
100
|
+
- [JsonLdWebSite]
|
|
101
|
+
- [JsonLdWebPage]
|
|
102
|
+
- [JsonLdBreadcrumbs]
|
|
103
|
+
- [JsonLdSiteNavigationElement]
|
|
104
|
+
|
|
105
|
+
See the linked _READMEs_ for detailed usage examples and supported properties.
|
|
106
|
+
|
|
107
|
+
## Usage
|
|
108
|
+
|
|
109
|
+
You can use any SEO component inside your route files or layout components. Here’s a minimal example:
|
|
110
|
+
|
|
111
|
+
```svelte
|
|
112
|
+
<script>
|
|
113
|
+
import type { OpenGraphType, TwitterCardType, SEOMenuItem } from '@indaco/sveo/types';
|
|
114
|
+
import PageMetaTags from '@indaco/sveo/metadata/PageMetaTags.svelte'
|
|
115
|
+
import TwitterCard from '@indaco/sveo/metadata/twittercard/TwitterCard.svelte';
|
|
116
|
+
import JsonLdWebSite from '@indaco/sveo/schemaorg/website/JsonLdWebSite.svelte'
|
|
117
|
+
</script>
|
|
118
|
+
|
|
119
|
+
<PageMetaTags
|
|
120
|
+
data={{
|
|
121
|
+
url: 'https://example.com/posts/getting-started',
|
|
122
|
+
title: 'Getting Started Article',
|
|
123
|
+
description: 'This is the description for the Getting Started Article',
|
|
124
|
+
author: 'Your Name',
|
|
125
|
+
keywords: ['sveltekit', 'components', 'tests', 'vitest'],
|
|
126
|
+
opengraph: {
|
|
127
|
+
type: OpenGraphType.Article,
|
|
128
|
+
article: {
|
|
129
|
+
published_time: '23-01-2022',
|
|
130
|
+
modified_time: '24-01-2022'
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
twitter: {
|
|
134
|
+
type: TwitterCardType.Large,
|
|
135
|
+
site: '@username'
|
|
136
|
+
}
|
|
137
|
+
}}
|
|
138
|
+
/>
|
|
139
|
+
|
|
140
|
+
<JsonLdWebSite
|
|
141
|
+
data={{
|
|
142
|
+
name: 'My Svelte App',
|
|
143
|
+
baseURL: 'https://example.com',
|
|
144
|
+
title: 'Getting Started Article',
|
|
145
|
+
description: 'This is a SvelteKit site using sveo for SEO.',
|
|
146
|
+
language: 'en',
|
|
147
|
+
socials: {
|
|
148
|
+
twitter: 'https://twitter.com/indaco',
|
|
149
|
+
github: 'https://github.com/indaco'
|
|
150
|
+
}
|
|
151
|
+
}}
|
|
152
|
+
/>
|
|
153
|
+
|
|
154
|
+
<JsonLdSiteNavigationElements
|
|
155
|
+
baseURL="https://example.com"
|
|
156
|
+
data={[
|
|
157
|
+
{ identifier: 'home', name: 'Home', url: '/', weight: 1 },
|
|
158
|
+
{ identifier: 'about', name: 'About', url: '/about', weight: 2 },
|
|
159
|
+
{
|
|
160
|
+
identifier: 'github',
|
|
161
|
+
name: 'GitHub',
|
|
162
|
+
url: 'https://github.com/indaco',
|
|
163
|
+
weight: 3,
|
|
164
|
+
external: true
|
|
165
|
+
}
|
|
166
|
+
] satisfies Array<SEOMenuItem>}
|
|
167
|
+
/>
|
|
168
|
+
|
|
169
|
+
<TwitterCard
|
|
170
|
+
data={{
|
|
171
|
+
url: 'https://example.com',
|
|
172
|
+
title: 'Amazing Svelte Site',
|
|
173
|
+
description: 'This site showcases the power of SvelteKit for SEO.',
|
|
174
|
+
keywords: ['svelte', 'sveltekit', 'seo'],
|
|
175
|
+
image: {
|
|
176
|
+
url: 'https://example.com/og-image.jpg',
|
|
177
|
+
alt: 'Preview of the Svelte site'
|
|
178
|
+
},
|
|
179
|
+
twitter: {
|
|
180
|
+
type: TwitterCardType.Player,
|
|
181
|
+
site: '@example',
|
|
182
|
+
player: {
|
|
183
|
+
url: 'https://example.com/player.html',
|
|
184
|
+
width: 640,
|
|
185
|
+
height: 360
|
|
186
|
+
},
|
|
187
|
+
app: {
|
|
188
|
+
country: 'US',
|
|
189
|
+
idIPhone: '1234567890',
|
|
190
|
+
idIPad: '0987654321',
|
|
191
|
+
idGooglePlay: 'com.example.app'
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}}
|
|
195
|
+
/>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
MIT - see the [License](LICENSE) file.
|
|
201
|
+
|
|
202
|
+
<!-- Resource Links -->
|
|
203
|
+
[PageMetaTags]: src/lib/components/metadata/README.md
|
|
204
|
+
[JsonLdWebSite]: src/lib/components/schemaorg/website/README.md
|
|
205
|
+
[JsonLdWebPage]: src/lib/components/schemaorg/webpage/README.md
|
|
206
|
+
[JsonLdBreadcrumbs]: src/lib/components/schemaorg/breadcrumbs/README.md
|
|
207
|
+
[JsonLdSiteNavigationElement]: src/lib/components/schemaorg/sitenavigationelements/README.md
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">import { OpenGraph } from './opengraph/index.js';
|
|
2
|
+
import { TwitterCard } from './twittercard/index.js';
|
|
3
|
+
let { data } = $props();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<svelte:head>
|
|
7
|
+
<title>{data.title}</title>
|
|
8
|
+
<link rel="canonical" href={data.url} />
|
|
9
|
+
{#if data.description}
|
|
10
|
+
<meta name="description" content={data.description} />
|
|
11
|
+
{/if}
|
|
12
|
+
{#if data.keywords?.length}
|
|
13
|
+
<meta name="keywords" content={data.keywords.join(', ')} />
|
|
14
|
+
{/if}
|
|
15
|
+
|
|
16
|
+
<OpenGraph {data} />
|
|
17
|
+
|
|
18
|
+
<TwitterCard {data} />
|
|
19
|
+
</svelte:head>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script lang="ts">import { OpenGraphType } from '../../../types.js';
|
|
2
|
+
import Article from './article.svelte';
|
|
3
|
+
import Book from './book.svelte';
|
|
4
|
+
import Business from './business.svelte';
|
|
5
|
+
import MusicAlbum from './music-album.svelte';
|
|
6
|
+
import MusicPlaylist from './music-playlist.svelte';
|
|
7
|
+
import MusicRadioStation from './music-radio-station.svelte';
|
|
8
|
+
import MusicSong from './music-song.svelte';
|
|
9
|
+
import Product from './product.svelte';
|
|
10
|
+
import Profile from './profile.svelte';
|
|
11
|
+
import VideoEpisode from './video-episode.svelte';
|
|
12
|
+
import VideoMovie from './video-movie.svelte';
|
|
13
|
+
let { data } = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
{#if data.opengraph && data.opengraph.type}
|
|
17
|
+
<meta property="og:type" content={data.opengraph.type} />
|
|
18
|
+
<meta property="og:url" content={data.url} />
|
|
19
|
+
<meta property="og:title" content={data.title} />
|
|
20
|
+
{#if data.description}
|
|
21
|
+
<meta property="og:description" content={data.description} />
|
|
22
|
+
{/if}
|
|
23
|
+
|
|
24
|
+
{#if data.image?.url}
|
|
25
|
+
<meta property="og:image" content={data.image.url} />
|
|
26
|
+
{#if data.image.alt}
|
|
27
|
+
<meta property="og:image:alt" content={data.image.alt} />
|
|
28
|
+
{/if}
|
|
29
|
+
{/if}
|
|
30
|
+
|
|
31
|
+
{#if data.opengraph.type == OpenGraphType.Article}
|
|
32
|
+
<Article {data} />
|
|
33
|
+
{:else if data.opengraph.type == OpenGraphType.Profile}
|
|
34
|
+
<Profile {data} />
|
|
35
|
+
{:else if data.opengraph.type == OpenGraphType.Book}
|
|
36
|
+
<Book {data} />
|
|
37
|
+
{:else if data.opengraph.type == OpenGraphType.Business}
|
|
38
|
+
<Business {data} />
|
|
39
|
+
{:else if data.opengraph.type == OpenGraphType.Product}
|
|
40
|
+
<Product {data} />
|
|
41
|
+
{:else if data.opengraph.type == OpenGraphType.MusicSong}
|
|
42
|
+
<MusicSong {data} />
|
|
43
|
+
{:else if data.opengraph.type == OpenGraphType.MusicAlbum}
|
|
44
|
+
<MusicAlbum {data} />
|
|
45
|
+
{:else if data.opengraph.type == OpenGraphType.MusicPlaylist}
|
|
46
|
+
<MusicPlaylist {data} />
|
|
47
|
+
{:else if data.opengraph.type == OpenGraphType.MusicRadioStation}
|
|
48
|
+
<MusicRadioStation {data} />
|
|
49
|
+
{:else if data.opengraph.type == OpenGraphType.VideoMovie || data.opengraph.type == OpenGraphType.VideoTVShow || data.opengraph.type == OpenGraphType.VideoOther}
|
|
50
|
+
<VideoMovie {data} />
|
|
51
|
+
{:else if data.opengraph.type == OpenGraphType.VideoEpisode}
|
|
52
|
+
<VideoEpisode {data} />
|
|
53
|
+
{/if}
|
|
54
|
+
{/if}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">import { toISODateString } from '../../../utils.js';
|
|
2
|
+
let { data } = $props();
|
|
3
|
+
const times = [
|
|
4
|
+
['published_time', data.opengraph?.article?.published_time],
|
|
5
|
+
['modified_time', data.opengraph?.article?.modified_time],
|
|
6
|
+
['expiration_time', data.opengraph?.article?.expiration_time]
|
|
7
|
+
];
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
{#each times as [key, value] (key)}
|
|
11
|
+
{#if value}
|
|
12
|
+
<meta property={`article:${key}`} content={toISODateString(value)} />
|
|
13
|
+
{/if}
|
|
14
|
+
{/each}
|
|
15
|
+
|
|
16
|
+
{#if data.author}
|
|
17
|
+
<meta property="article:author" content={data.author} />
|
|
18
|
+
{/if}
|
|
19
|
+
|
|
20
|
+
{#if data.opengraph?.article?.section}
|
|
21
|
+
<meta property="article:section" content={data.opengraph.article.section} />
|
|
22
|
+
{/if}
|
|
23
|
+
|
|
24
|
+
{#if Array.isArray(data.opengraph?.article?.tags)}
|
|
25
|
+
{@const _tags = data.opengraph.article.tags}
|
|
26
|
+
{#each _tags as tag (tag)}
|
|
27
|
+
<meta property="article:tag" content={tag} />
|
|
28
|
+
{/each}
|
|
29
|
+
{/if}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">import { toISODateString } from '../../../utils.js';
|
|
2
|
+
let { data } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
{#if data.opengraph?.book?.author}
|
|
6
|
+
<meta property="book:author" content={data.opengraph.book.author} />
|
|
7
|
+
{/if}
|
|
8
|
+
|
|
9
|
+
{#if data.opengraph?.book?.isbn}
|
|
10
|
+
<meta property="book:isbn" content={data.opengraph.book.isbn} />
|
|
11
|
+
{/if}
|
|
12
|
+
|
|
13
|
+
{#if data.opengraph?.book?.release_date}
|
|
14
|
+
<meta property="book:release_date" content={toISODateString(data.opengraph.book.release_date)} />
|
|
15
|
+
{/if}
|
|
16
|
+
|
|
17
|
+
{#if Array.isArray(data.opengraph?.book?.tags)}
|
|
18
|
+
{@const _tags = data.opengraph.book.tags}
|
|
19
|
+
{#each _tags as tag (tag)}
|
|
20
|
+
<meta property="book:tag" content={tag} />
|
|
21
|
+
{/each}
|
|
22
|
+
{/if}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">let { data } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
{#if data.opengraph?.business?.street_address}
|
|
6
|
+
<meta
|
|
7
|
+
property="business:contact_data:street_address"
|
|
8
|
+
content={data.opengraph.business.street_address}
|
|
9
|
+
/>
|
|
10
|
+
{/if}
|
|
11
|
+
|
|
12
|
+
{#if data.opengraph?.business?.city}
|
|
13
|
+
<meta property="business:contact_data:locality" content={data.opengraph.business.city} />
|
|
14
|
+
{/if}
|
|
15
|
+
|
|
16
|
+
{#if data.opengraph?.business?.state}
|
|
17
|
+
<meta property="business:contact_data:region" content={data.opengraph.business.state} />
|
|
18
|
+
{/if}
|
|
19
|
+
|
|
20
|
+
{#if data.opengraph?.business?.postal_code}
|
|
21
|
+
<meta
|
|
22
|
+
property="business:contact_data:postal_code"
|
|
23
|
+
content={data.opengraph.business.postal_code.toString()}
|
|
24
|
+
/>
|
|
25
|
+
{/if}
|
|
26
|
+
|
|
27
|
+
{#if data.opengraph?.business?.country}
|
|
28
|
+
<meta property="business:contact_data:country_name" content={data.opengraph.business.country} />
|
|
29
|
+
{/if}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OpenGraph } from './OpenGraph.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OpenGraph } from './OpenGraph.svelte';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script lang="ts">import { toISODateString } from '../../../utils.js';
|
|
2
|
+
let { data } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
{#if data.opengraph?.album?.url}
|
|
6
|
+
<meta property="og:audio" content={data.opengraph.album.url} />
|
|
7
|
+
{/if}
|
|
8
|
+
|
|
9
|
+
{#if data.opengraph?.album?.release_date}
|
|
10
|
+
<meta
|
|
11
|
+
property="music:release_date"
|
|
12
|
+
content={toISODateString(data.opengraph.album.release_date)}
|
|
13
|
+
/>
|
|
14
|
+
{/if}
|
|
15
|
+
|
|
16
|
+
{#if Array.isArray(data.opengraph?.album?.musicians)}
|
|
17
|
+
{#each data.opengraph.album.musicians as musician (musician)}
|
|
18
|
+
<meta property="music:musician" content={musician.url} />
|
|
19
|
+
{/each}
|
|
20
|
+
{/if}
|
|
21
|
+
|
|
22
|
+
{#if Array.isArray(data.opengraph?.album?.songs)}
|
|
23
|
+
{#each data.opengraph.album.songs as song (song)}
|
|
24
|
+
<meta property="music:song" content={song.url} />
|
|
25
|
+
{/each}
|
|
26
|
+
{/if}
|
|
27
|
+
|
|
28
|
+
{#if data.opengraph?.album?.disc}
|
|
29
|
+
<meta property="music:album:disc" content={data.opengraph.album.disc.toString()} />
|
|
30
|
+
{/if}
|
|
31
|
+
|
|
32
|
+
{#if data.opengraph?.album?.track}
|
|
33
|
+
<meta property="music:album:track" content={data.opengraph.album.track.toString()} />
|
|
34
|
+
{/if}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">let { data } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
{#if data.opengraph?.playlist?.song}
|
|
6
|
+
<meta property="music:song" content={data.opengraph.playlist.song.url} />
|
|
7
|
+
{/if}
|
|
8
|
+
|
|
9
|
+
{#if data.opengraph?.playlist?.song?.disc}
|
|
10
|
+
<meta property="music:song:disc" content={data.opengraph.playlist.song.disc.toString()} />
|
|
11
|
+
{/if}
|
|
12
|
+
|
|
13
|
+
{#if data.opengraph?.playlist?.song?.track}
|
|
14
|
+
<meta property="music:song:track" content={data.opengraph.playlist.song.track.toString()} />
|
|
15
|
+
{/if}
|
|
16
|
+
|
|
17
|
+
{#if data.opengraph?.playlist?.creator}
|
|
18
|
+
<meta property="music:creator" content={data.opengraph.playlist.creator.url} />
|
|
19
|
+
{/if}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SEOWebPage } from '../../../types.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
data: SEOWebPage;
|
|
4
|
+
}
|
|
5
|
+
declare const MusicRadioStation: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type MusicRadioStation = ReturnType<typeof MusicRadioStation>;
|
|
7
|
+
export default MusicRadioStation;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">let { data } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
{#if data.opengraph?.song?.url}
|
|
6
|
+
<meta property="og:audio" content={data.opengraph.song.url} />
|
|
7
|
+
{/if}
|
|
8
|
+
|
|
9
|
+
{#if data.opengraph?.song?.duration}
|
|
10
|
+
<meta property="music:duration" content={data.opengraph.song.duration.toString()} />
|
|
11
|
+
{/if}
|
|
12
|
+
|
|
13
|
+
{#if Array.isArray(data.opengraph?.song?.album)}
|
|
14
|
+
{#each data.opengraph.song.album as album (album)}
|
|
15
|
+
<meta property="music:album" content={album.url} />
|
|
16
|
+
{/each}
|
|
17
|
+
{/if}
|
|
18
|
+
|
|
19
|
+
{#if data.opengraph?.song?.disc}
|
|
20
|
+
<meta property="music:album:disc" content={data.opengraph.song.disc.toString()} />
|
|
21
|
+
{/if}
|
|
22
|
+
|
|
23
|
+
{#if data.opengraph?.song?.track}
|
|
24
|
+
<meta property="music:album:track" content={data.opengraph.song.track.toString()} />
|
|
25
|
+
{/if}
|
|
26
|
+
|
|
27
|
+
{#if Array.isArray(data.opengraph?.song?.musician)}
|
|
28
|
+
{#each data.opengraph.song.musician as musician (musician)}
|
|
29
|
+
<meta property="music:musician" content={musician.url} />
|
|
30
|
+
{/each}
|
|
31
|
+
{/if}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">let { data } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
{#if data.opengraph?.product?.plural_title}
|
|
6
|
+
<meta property="product:plural_title" content={data.opengraph.product.plural_title} />
|
|
7
|
+
{/if}
|
|
8
|
+
|
|
9
|
+
{#if data.opengraph?.product?.price}
|
|
10
|
+
<meta property="product:price.amount" content={data.opengraph.product.price.toString()} />
|
|
11
|
+
{/if}
|
|
12
|
+
|
|
13
|
+
{#if data.opengraph?.product?.currency}
|
|
14
|
+
<meta property="product:price.currency" content={data.opengraph.product.currency} />
|
|
15
|
+
{/if}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">let { data } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
{#if data.opengraph?.profile?.first_name}
|
|
6
|
+
<meta property="profile:first_name" content={data.opengraph.profile.first_name} />
|
|
7
|
+
{/if}
|
|
8
|
+
|
|
9
|
+
{#if data.opengraph?.profile?.last_name}
|
|
10
|
+
<meta property="profile:last_name" content={data.opengraph.profile.last_name} />
|
|
11
|
+
{/if}
|
|
12
|
+
|
|
13
|
+
{#if data.opengraph?.profile?.username}
|
|
14
|
+
<meta property="profile:username" content={data.opengraph.profile.username} />
|
|
15
|
+
{/if}
|
|
16
|
+
|
|
17
|
+
{#if data.opengraph?.profile?.gender}
|
|
18
|
+
<meta property="profile:gender" content={data.opengraph.profile.gender} />
|
|
19
|
+
{/if}
|