vowel 0.1.39 → 0.1.40
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.1.40](https://github.com/samlfair/vowel/compare/v0.1.39...v0.1.40) (2024-10-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add h-entry microformat markup ([875b509](https://github.com/samlfair/vowel/commit/875b5092e5cf050149114ba31e1972a9c0f1dfa7))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* link preview bug ([293f88f](https://github.com/samlfair/vowel/commit/293f88fcb089d70c4d1e9e4c08668f03a6244b63))
|
|
16
|
+
|
|
5
17
|
## [0.1.39](https://github.com/samlfair/vowel/compare/v0.1.38...v0.1.39) (2024-10-17)
|
|
6
18
|
|
|
7
19
|
## [0.1.38](https://github.com/samlfair/vowel/compare/v0.1.37...v0.1.38) (2024-10-17)
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { kebabCase } from 'change-case';
|
|
5
5
|
import Image from './Markdown/Image.svelte';
|
|
6
6
|
|
|
7
|
-
let { page, content = true, link, level = 0, website = {}, format = 'html' } = $props();
|
|
7
|
+
let { page, content = true, link, level = 0, website = {}, format = 'html', webmentions } = $props();
|
|
8
8
|
let { ast, title, date, image, imputedProperties } = $derived(page || {});
|
|
9
9
|
|
|
10
10
|
let headerImage = $derived(image?.output || !content && imputedProperties.image)
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<!-- Title -->
|
|
30
30
|
{#if title}
|
|
31
31
|
{#if link && page.url}
|
|
32
|
-
<h1>
|
|
32
|
+
<h1 class="p-name">
|
|
33
33
|
<a href={page.url}>
|
|
34
34
|
{page.imputedProperties.title || title || page.imputedProperties?.fileName}
|
|
35
35
|
</a>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
<!-- Date -->
|
|
43
43
|
{#if link}
|
|
44
44
|
{#if dateObject}
|
|
45
|
-
<time datetime={dateObject.toISOString()}>
|
|
45
|
+
<time class="dt-published" datetime={dateObject.toISOString()}>
|
|
46
46
|
<a href={page.url}>
|
|
47
47
|
{dateObject.toLocaleDateString()}
|
|
48
48
|
</a>
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<Frontmatter props={{ properties: page, website, format }} />
|
|
56
56
|
|
|
57
57
|
{#if page?.description || (!content && page?.imputedProperties?.description)}
|
|
58
|
-
<p class="description">{page?.description || page?.imputedProperties.description}</p>
|
|
58
|
+
<p class="description p-summary">{page?.description || page?.imputedProperties.description}</p>
|
|
59
59
|
{/if}
|
|
60
60
|
|
|
61
61
|
{#if format === 'html' && page.toc && headings.length > 1}
|
|
@@ -75,7 +75,16 @@
|
|
|
75
75
|
{/if}
|
|
76
76
|
|
|
77
77
|
{#if level < 2 && content}
|
|
78
|
-
<
|
|
78
|
+
<section class="content e-content">
|
|
79
79
|
<Markdown props={{ ast, level, website, format }} />
|
|
80
|
-
</
|
|
80
|
+
</section>
|
|
81
81
|
{/if}
|
|
82
|
+
|
|
83
|
+
{#if level < 2 && content && website._.webmentions && webmentions.children.length}
|
|
84
|
+
<section class="webmentions">
|
|
85
|
+
<h2>Webmentions</h2>
|
|
86
|
+
{#each webmentions.children as webmention}
|
|
87
|
+
<a href={webmention.url} target="_blank">{webmention.url}</a>
|
|
88
|
+
{/each}
|
|
89
|
+
</section>
|
|
90
|
+
{/if}
|
|
@@ -33,6 +33,10 @@ export default async function mutateMarkdownAST(ast, cache, webmentions) {
|
|
|
33
33
|
ensureSecureImageRequest: true
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
+
console.log(!!webmentions)
|
|
37
|
+
console.log({webmentions})
|
|
38
|
+
console.log(webmentions.find(webmention => webmention.target === url))
|
|
39
|
+
|
|
36
40
|
|
|
37
41
|
if(webmentions && !webmentions.find(webmention => webmention.target === url)) {
|
|
38
42
|
webmentions.push({
|
|
@@ -67,7 +71,7 @@ export default async function mutateMarkdownAST(ast, cache, webmentions) {
|
|
|
67
71
|
node.value = url;
|
|
68
72
|
}
|
|
69
73
|
} else {
|
|
70
|
-
node.metadata = cache[
|
|
74
|
+
node.metadata = cache[url];
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
} else if (node.children[0].type === 'image') {
|
|
@@ -3,11 +3,18 @@ import { getPagesByFolder, processMarkdownFiles, loadCache } from '../../lib/uti
|
|
|
3
3
|
export const prerender = true;
|
|
4
4
|
|
|
5
5
|
/** @type {import('./$types').PageLoad} */
|
|
6
|
-
export async function load({ params }) {
|
|
6
|
+
export async function load({ params, parent }) {
|
|
7
|
+
const { website } = await parent()
|
|
8
|
+
const url = new URL(params.path, website._.domain)
|
|
9
|
+
|
|
10
|
+
const webmentionTarget = params.path === "" ? url.origin : url.href
|
|
11
|
+
|
|
12
|
+
const webmentions = await (await fetch(`https://webmention.io/api/mentions.jf2?target=${webmentionTarget}`)).json()
|
|
13
|
+
|
|
7
14
|
const { path } = params;
|
|
8
15
|
const segments = path ? params.path.split('/') : [];
|
|
9
16
|
|
|
10
|
-
return { path, segments };
|
|
17
|
+
return { path, segments, webmentions };
|
|
11
18
|
}
|
|
12
19
|
|
|
13
20
|
export async function entries() {
|
|
@@ -173,8 +173,8 @@
|
|
|
173
173
|
<Breadcrumbs level={0} />
|
|
174
174
|
</nav>
|
|
175
175
|
</header>
|
|
176
|
-
<main>
|
|
177
|
-
<Page level={0} {page} {website} path={data.path} />
|
|
176
|
+
<main class="h-entry">
|
|
177
|
+
<Page level={0} {page} {website} path={data.path} webmentions={data.webmentions} />
|
|
178
178
|
</main>
|
|
179
179
|
<nav class="sidebar">
|
|
180
180
|
<Sitemap section={website} segments={data.path.split('/')} root />
|