@turnipxenon/pineapple 4.1.3 → 4.2.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/dist/modules/overrideable_meta/OverridableMeta.svelte +23 -35
- package/dist/modules/overrideable_meta/OverridableMeta.svelte.d.ts +1 -1
- package/dist/modules/parsnip/ParsnipBlockChildren.svelte +2 -0
- package/dist/modules/parsnip/ParsnipOverall.d.ts +2 -0
- package/dist/modules/parsnip/ParsnipPhrasingChildren.svelte +4 -0
- package/dist/modules/parsnip/ParsnipWikilink.svelte +1 -1
- package/dist/modules/parsnip/route-util/ParsnipBlog.svelte +2 -2
- package/dist/ui/modules/NavigationMenu/NavigationMenu.svelte +4 -2
- package/dist/ui/templates/PinyaBase.svelte +15 -1
- package/dist/ui/templates/runes.svelte.d.ts +8 -0
- package/dist/ui/templates/runes.svelte.js +9 -0
- package/package.json +1 -1
|
@@ -17,50 +17,38 @@ export const load = async (): Promise<OverridableMetaProps> => {
|
|
|
17
17
|
-->
|
|
18
18
|
|
|
19
19
|
<script lang="ts">
|
|
20
|
-
import
|
|
20
|
+
import { pinyaHead } from "../../ui/templates/runes.svelte";
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
import { page } from "$app/stores";
|
|
24
|
-
import type { OverridableMetaProps } from "./OverridableMetaProps";
|
|
25
22
|
interface Props {
|
|
26
23
|
rootUrl?: string;
|
|
27
24
|
title?: string;
|
|
28
25
|
ogTitle?: string;
|
|
29
26
|
ogDescription?: string;
|
|
30
|
-
ogImage?:
|
|
27
|
+
ogImage?: string[];
|
|
31
28
|
}
|
|
32
29
|
|
|
33
30
|
let {
|
|
34
|
-
rootUrl =
|
|
35
|
-
title =
|
|
36
|
-
ogTitle =
|
|
37
|
-
ogDescription =
|
|
38
|
-
ogImage =
|
|
31
|
+
rootUrl = undefined,
|
|
32
|
+
title = undefined,
|
|
33
|
+
ogTitle = undefined,
|
|
34
|
+
ogDescription = undefined,
|
|
35
|
+
ogImage = undefined
|
|
39
36
|
}: Props = $props();
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
if (rootUrl) {
|
|
39
|
+
pinyaHead.rootUrl = rootUrl;
|
|
40
|
+
}
|
|
41
|
+
if (title) {
|
|
42
|
+
console.log('setting titel', title)
|
|
43
|
+
pinyaHead.title = title;
|
|
44
|
+
}
|
|
45
|
+
if (ogTitle) {
|
|
46
|
+
pinyaHead.ogTitle = ogTitle;
|
|
47
|
+
}
|
|
48
|
+
if (ogDescription) {
|
|
49
|
+
pinyaHead.ogDescription = ogDescription;
|
|
50
|
+
}
|
|
51
|
+
if (ogImage) {
|
|
52
|
+
pinyaHead.ogImage = ogImage;
|
|
53
|
+
}
|
|
56
54
|
</script>
|
|
57
|
-
|
|
58
|
-
<svelte:head>
|
|
59
|
-
<meta charset="utf-8" />
|
|
60
|
-
<title>{data.title}</title>
|
|
61
|
-
<meta name="twitter:card" content="summary" />
|
|
62
|
-
<meta property="og:url" content={data.ogUrl} />
|
|
63
|
-
<meta property="og:title" content={data.ogTitle} />
|
|
64
|
-
<meta property="og:description" content={data.ogDescription} />
|
|
65
|
-
<meta property="og:image" content={data.ogImage} />
|
|
66
|
-
</svelte:head>
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
</strong>
|
|
17
17
|
{:else if child.type === 'inlineCode'}
|
|
18
18
|
<code class="inline-code">{child.value}</code>
|
|
19
|
+
{:else if child.type === 'link'}
|
|
20
|
+
<a href={child.url}>
|
|
21
|
+
<Self phrasingChildren={child.children} />
|
|
22
|
+
</a>
|
|
19
23
|
{:else if child.type === 'embedWikilink'}
|
|
20
24
|
<ParsnipEmbedWikilink wikilink={child} />
|
|
21
25
|
{:else if child.type === 'wikilink'}
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
|
|
18
18
|
<!-- todo(turnip): determine appropriate media -->
|
|
19
19
|
<!-- todo(turnip): add alt text -->
|
|
20
|
-
<a href={`${getWebBaseUrl()}/${wikilink.fileAccessor.slug}`}>{wikilink.fileAccessor.target}</a>
|
|
20
|
+
<a href={`${getWebBaseUrl()}/${wikilink.fileAccessor.slug}`} data-sveltekit-reload>{wikilink.fileAccessor.target}</a>
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
<OverridableMeta
|
|
22
22
|
title={parsnipEntry.basename}
|
|
23
23
|
ogTitle={parsnipEntry.basename}
|
|
24
|
-
ogDescription=
|
|
25
|
-
ogImage={`${getCmsBaseUrl()}/${parsnipEntry.preview}`}
|
|
24
|
+
ogDescription={parsnipEntry.tagline}
|
|
25
|
+
ogImage={[`${getCmsBaseUrl()}/${parsnipEntry.preview}`]}
|
|
26
26
|
/>
|
|
27
27
|
|
|
28
28
|
<BlogTemplate pageMeta={pageMeta}>
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
pageSize = $bindable(5),
|
|
41
41
|
currentIndex = $bindable(0),
|
|
42
42
|
parsnipOverall = undefined,
|
|
43
|
-
parsnipBasePath =
|
|
43
|
+
parsnipBasePath = ""
|
|
44
44
|
}: Props = $props();
|
|
45
45
|
|
|
46
46
|
const fileBasedList = parsePageMeta(fileList, jsonList, imageMap, compareFn);
|
|
@@ -51,8 +51,10 @@
|
|
|
51
51
|
relativeLink: `${parsnipBasePath}${pf.slug}`,
|
|
52
52
|
tags: pf.tags,
|
|
53
53
|
imageUrl: pf.preview ? `${parsnipOverall.baseUrl}/${pf.preview}` : undefined,
|
|
54
|
+
imageAlt: pf.previewAlt,
|
|
54
55
|
datePublished: pf.stat.ctime ? new Date(pf.stat.ctime).toISOString().split("T")[0] : undefined,
|
|
55
|
-
lastUpdated: pf.stat.mtime ? new Date(pf.stat.mtime).toISOString().split("T")[0] : undefined
|
|
56
|
+
lastUpdated: pf.stat.mtime ? new Date(pf.stat.mtime).toISOString().split("T")[0] : undefined,
|
|
57
|
+
description: pf.tagline
|
|
56
58
|
};
|
|
57
59
|
return meta;
|
|
58
60
|
}) ?? [];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { pinyaHead } from "./runes.svelte";
|
|
2
3
|
import { ModeWatcher } from "mode-watcher";
|
|
3
4
|
import { Modals } from "svelte-modals";
|
|
4
5
|
import { page } from "$app/state";
|
|
@@ -9,8 +10,21 @@
|
|
|
9
10
|
import { ToastProvider } from "@skeletonlabs/skeleton-svelte";
|
|
10
11
|
|
|
11
12
|
let { children } = $props();
|
|
13
|
+
|
|
14
|
+
const ogUrl = $derived(`${pinyaHead.rootUrl}${page.url.pathname}`);
|
|
12
15
|
</script>
|
|
13
16
|
|
|
17
|
+
<svelte:head>
|
|
18
|
+
<meta charset="utf-8" />
|
|
19
|
+
<title>{pinyaHead.title}</title>
|
|
20
|
+
<meta property="og:url" content={ogUrl} />
|
|
21
|
+
<meta property="og:title" content={pinyaHead.ogTitle} />
|
|
22
|
+
<meta property="og:description" content={pinyaHead.ogDescription} />
|
|
23
|
+
{#each pinyaHead.ogImage ?? [] as imgUrl, idx (`${idx}_${imgUrl}`)}
|
|
24
|
+
<meta property="og:image" content={imgUrl} />
|
|
25
|
+
{/each}
|
|
26
|
+
</svelte:head>
|
|
27
|
+
|
|
14
28
|
<Modals>
|
|
15
29
|
<!-- shown when any modal is opened -->
|
|
16
30
|
{#snippet backdrop({ close })}
|
|
@@ -45,4 +59,4 @@
|
|
|
45
59
|
background: rgba(0, 0, 0, 0.50);
|
|
46
60
|
backdrop-filter: blur(4px);
|
|
47
61
|
}
|
|
48
|
-
</style>
|
|
62
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import WebThumbnailImage from "../../assets/placeholder/placeholder_circle.png";
|
|
2
|
+
const defaultData = {
|
|
3
|
+
rootUrl: "http://localhost:5173",
|
|
4
|
+
title: "Welcome to my portfolio",
|
|
5
|
+
ogTitle: "Turnip time!",
|
|
6
|
+
ogDescription: "Welcome to Turnip's test portfolio",
|
|
7
|
+
ogImage: [WebThumbnailImage]
|
|
8
|
+
};
|
|
9
|
+
export const pinyaHead = $state({ ...defaultData });
|
package/package.json
CHANGED