@scribe-atp/next 0.1.0 → 0.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/index.cjs +5 -5
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -34,12 +34,12 @@ function createScribeSite(author, siteSlug) {
|
|
|
34
34
|
},
|
|
35
35
|
generateArticleParams: async () => {
|
|
36
36
|
const site = await (0, import_core.fetchSite)(author, siteSlug);
|
|
37
|
-
return site.groups.flatMap((g) => g.articles).filter((a) => !!a.
|
|
37
|
+
return site.groups.flatMap((g) => g.articles).filter((a) => !!a.slug).map((a) => ({ articleSlug: a.slug }));
|
|
38
38
|
},
|
|
39
39
|
generateGroupArticleParams: async () => {
|
|
40
40
|
const site = await (0, import_core.fetchSite)(author, siteSlug);
|
|
41
41
|
return site.groups.flatMap(
|
|
42
|
-
(g) => g.articles.filter((a) => !!a.
|
|
42
|
+
(g) => g.articles.filter((a) => !!a.slug).map((a) => ({ groupSlug: g.slug, articleSlug: a.slug }))
|
|
43
43
|
);
|
|
44
44
|
},
|
|
45
45
|
generateSiteMetadata: async () => {
|
|
@@ -65,14 +65,14 @@ function createScribeSite(author, siteSlug) {
|
|
|
65
65
|
},
|
|
66
66
|
generateArticleMetadata: async (articleSlug) => {
|
|
67
67
|
const site = await (0, import_core.fetchSite)(author, siteSlug);
|
|
68
|
-
const article = site.groups.flatMap((g) => g.articles).find((a) => a.
|
|
68
|
+
const article = site.groups.flatMap((g) => g.articles).find((a) => a.slug === articleSlug);
|
|
69
69
|
const title = article ? `${article.title} \u2014 ${site.title}` : site.title;
|
|
70
70
|
return {
|
|
71
71
|
title,
|
|
72
|
-
description: article?.
|
|
72
|
+
description: article?.description ?? void 0,
|
|
73
73
|
openGraph: {
|
|
74
74
|
title,
|
|
75
|
-
description: article?.
|
|
75
|
+
description: article?.description ?? void 0,
|
|
76
76
|
...article?.splashImageUrl ? { images: [article.splashImageUrl] } : {}
|
|
77
77
|
}
|
|
78
78
|
};
|
package/dist/index.js
CHANGED
|
@@ -8,12 +8,12 @@ function createScribeSite(author, siteSlug) {
|
|
|
8
8
|
},
|
|
9
9
|
generateArticleParams: async () => {
|
|
10
10
|
const site = await fetchSite(author, siteSlug);
|
|
11
|
-
return site.groups.flatMap((g) => g.articles).filter((a) => !!a.
|
|
11
|
+
return site.groups.flatMap((g) => g.articles).filter((a) => !!a.slug).map((a) => ({ articleSlug: a.slug }));
|
|
12
12
|
},
|
|
13
13
|
generateGroupArticleParams: async () => {
|
|
14
14
|
const site = await fetchSite(author, siteSlug);
|
|
15
15
|
return site.groups.flatMap(
|
|
16
|
-
(g) => g.articles.filter((a) => !!a.
|
|
16
|
+
(g) => g.articles.filter((a) => !!a.slug).map((a) => ({ groupSlug: g.slug, articleSlug: a.slug }))
|
|
17
17
|
);
|
|
18
18
|
},
|
|
19
19
|
generateSiteMetadata: async () => {
|
|
@@ -39,14 +39,14 @@ function createScribeSite(author, siteSlug) {
|
|
|
39
39
|
},
|
|
40
40
|
generateArticleMetadata: async (articleSlug) => {
|
|
41
41
|
const site = await fetchSite(author, siteSlug);
|
|
42
|
-
const article = site.groups.flatMap((g) => g.articles).find((a) => a.
|
|
42
|
+
const article = site.groups.flatMap((g) => g.articles).find((a) => a.slug === articleSlug);
|
|
43
43
|
const title = article ? `${article.title} \u2014 ${site.title}` : site.title;
|
|
44
44
|
return {
|
|
45
45
|
title,
|
|
46
|
-
description: article?.
|
|
46
|
+
description: article?.description ?? void 0,
|
|
47
47
|
openGraph: {
|
|
48
48
|
title,
|
|
49
|
-
description: article?.
|
|
49
|
+
description: article?.description ?? void 0,
|
|
50
50
|
...article?.splashImageUrl ? { images: [article.splashImageUrl] } : {}
|
|
51
51
|
}
|
|
52
52
|
};
|