@beeblock/svelar 0.6.0 → 0.6.2
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/README.md +1 -0
- package/dist/cli/bin.js +218 -211
- package/package.json +1 -4
- package/src/ui/Seo.svelte +104 -0
- package/src/ui/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beeblock/svelar",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Laravel-inspired framework on top of SvelteKit 2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -269,7 +269,6 @@
|
|
|
269
269
|
"@vitest/coverage-v8": "^2.1.9",
|
|
270
270
|
"better-sqlite3": "^11.0.0",
|
|
271
271
|
"exceljs": "^4.4.0",
|
|
272
|
-
|
|
273
272
|
"sveltekit-superforms": "^2.30.1",
|
|
274
273
|
"tsup": "^8.3.0",
|
|
275
274
|
"typescript": "^5.7.0",
|
|
@@ -288,7 +287,6 @@
|
|
|
288
287
|
"pdfkit": ">=0.18.0",
|
|
289
288
|
"postgres": "*",
|
|
290
289
|
"pusher-js": ">=8.0.0",
|
|
291
|
-
|
|
292
290
|
"sveltekit-superforms": ">=2.0.0",
|
|
293
291
|
"vitest": ">=1.0.0"
|
|
294
292
|
},
|
|
@@ -329,7 +327,6 @@
|
|
|
329
327
|
"meilisearch": {
|
|
330
328
|
"optional": true
|
|
331
329
|
},
|
|
332
|
-
|
|
333
330
|
"vitest": {
|
|
334
331
|
"optional": true
|
|
335
332
|
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
// Basic
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
keywords?: string;
|
|
9
|
+
canonical?: string;
|
|
10
|
+
|
|
11
|
+
// Open Graph
|
|
12
|
+
ogTitle?: string;
|
|
13
|
+
ogDescription?: string;
|
|
14
|
+
ogImage?: string;
|
|
15
|
+
ogUrl?: string;
|
|
16
|
+
ogType?: string;
|
|
17
|
+
ogSiteName?: string;
|
|
18
|
+
ogLocale?: string;
|
|
19
|
+
|
|
20
|
+
// Twitter Card
|
|
21
|
+
twitterCard?: 'summary' | 'summary_large_image' | 'app' | 'player';
|
|
22
|
+
twitterSite?: string;
|
|
23
|
+
twitterCreator?: string;
|
|
24
|
+
twitterTitle?: string;
|
|
25
|
+
twitterDescription?: string;
|
|
26
|
+
twitterImage?: string;
|
|
27
|
+
|
|
28
|
+
// Robots
|
|
29
|
+
robots?: string;
|
|
30
|
+
noindex?: boolean;
|
|
31
|
+
nofollow?: boolean;
|
|
32
|
+
|
|
33
|
+
// JSON-LD structured data (pass a plain object, rendered as <script type="application/ld+json">)
|
|
34
|
+
jsonLd?: Record<string, any>;
|
|
35
|
+
|
|
36
|
+
// Extra <svelte:head> content
|
|
37
|
+
children?: Snippet;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let {
|
|
41
|
+
title,
|
|
42
|
+
description,
|
|
43
|
+
keywords,
|
|
44
|
+
canonical,
|
|
45
|
+
ogTitle,
|
|
46
|
+
ogDescription,
|
|
47
|
+
ogImage,
|
|
48
|
+
ogUrl,
|
|
49
|
+
ogType = 'website',
|
|
50
|
+
ogSiteName,
|
|
51
|
+
ogLocale,
|
|
52
|
+
twitterCard = 'summary_large_image',
|
|
53
|
+
twitterSite,
|
|
54
|
+
twitterCreator,
|
|
55
|
+
twitterTitle,
|
|
56
|
+
twitterDescription,
|
|
57
|
+
twitterImage,
|
|
58
|
+
robots,
|
|
59
|
+
noindex = false,
|
|
60
|
+
nofollow = false,
|
|
61
|
+
jsonLd,
|
|
62
|
+
children,
|
|
63
|
+
}: Props = $props();
|
|
64
|
+
|
|
65
|
+
// Build robots directive
|
|
66
|
+
let robotsContent = $derived(
|
|
67
|
+
robots ?? [noindex ? 'noindex' : '', nofollow ? 'nofollow' : ''].filter(Boolean).join(', ')
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
// Serialize JSON-LD
|
|
71
|
+
let jsonLdScript = $derived(jsonLd ? JSON.stringify(jsonLd) : '');
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<svelte:head>
|
|
75
|
+
{#if title}<title>{title}</title>{/if}
|
|
76
|
+
{#if description}<meta name="description" content={description} />{/if}
|
|
77
|
+
{#if keywords}<meta name="keywords" content={keywords} />{/if}
|
|
78
|
+
{#if canonical}<link rel="canonical" href={canonical} />{/if}
|
|
79
|
+
{#if robotsContent}<meta name="robots" content={robotsContent} />{/if}
|
|
80
|
+
|
|
81
|
+
<!-- Open Graph -->
|
|
82
|
+
{#if ogTitle || title}<meta property="og:title" content={ogTitle ?? title} />{/if}
|
|
83
|
+
{#if ogDescription || description}<meta property="og:description" content={ogDescription ?? description} />{/if}
|
|
84
|
+
{#if ogImage}<meta property="og:image" content={ogImage} />{/if}
|
|
85
|
+
{#if ogUrl || canonical}<meta property="og:url" content={ogUrl ?? canonical} />{/if}
|
|
86
|
+
{#if ogType}<meta property="og:type" content={ogType} />{/if}
|
|
87
|
+
{#if ogSiteName}<meta property="og:site_name" content={ogSiteName} />{/if}
|
|
88
|
+
{#if ogLocale}<meta property="og:locale" content={ogLocale} />{/if}
|
|
89
|
+
|
|
90
|
+
<!-- Twitter Card -->
|
|
91
|
+
{#if twitterCard}<meta name="twitter:card" content={twitterCard} />{/if}
|
|
92
|
+
{#if twitterSite}<meta name="twitter:site" content={twitterSite} />{/if}
|
|
93
|
+
{#if twitterCreator}<meta name="twitter:creator" content={twitterCreator} />{/if}
|
|
94
|
+
{#if twitterTitle || ogTitle || title}<meta name="twitter:title" content={twitterTitle ?? ogTitle ?? title} />{/if}
|
|
95
|
+
{#if twitterDescription || ogDescription || description}<meta name="twitter:description" content={twitterDescription ?? ogDescription ?? description} />{/if}
|
|
96
|
+
{#if twitterImage || ogImage}<meta name="twitter:image" content={twitterImage ?? ogImage} />{/if}
|
|
97
|
+
|
|
98
|
+
<!-- JSON-LD Structured Data -->
|
|
99
|
+
{#if jsonLdScript}
|
|
100
|
+
{@html `<script type="application/ld+json">${jsonLdScript}</script>`}
|
|
101
|
+
{/if}
|
|
102
|
+
|
|
103
|
+
{#if children}{@render children()}{/if}
|
|
104
|
+
</svelte:head>
|
package/src/ui/index.ts
CHANGED
|
@@ -28,4 +28,5 @@ export { default as TabsList } from './TabsList.svelte';
|
|
|
28
28
|
export { default as TabsTrigger } from './TabsTrigger.svelte';
|
|
29
29
|
export { default as TabsContent } from './TabsContent.svelte';
|
|
30
30
|
export { default as Toaster } from './Toaster.svelte';
|
|
31
|
+
export { default as Seo } from './Seo.svelte';
|
|
31
32
|
export { toast, subscribe as toastSubscribe, getToasts, dismiss, pauseToast, resumeToast, type ToastItem, type ToastVariant, type ToastOptions, type ToastState } from './toast.ts';
|