@yimingliao/cms 0.0.236 → 0.0.237
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/src/shared/seo-metadata/build-article-metadata.js +4 -3
- package/dist/src/shared/seo-metadata/build-website-metadata.js +3 -3
- package/dist/types/src/shared/seo-metadata/build-article-metadata.d.ts +4 -1
- package/dist/types/src/shared/seo-metadata/build-article-metadata.d.ts.map +1 -1
- package/dist/types/src/shared/seo-metadata/build-website-metadata.d.ts +4 -1
- package/dist/types/src/shared/seo-metadata/build-website-metadata.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import { sanitizeStringArray } from './utils/sanitize-string-array.js';
|
|
|
7
7
|
import { toIsoTime } from './utils/to-iso-time.js';
|
|
8
8
|
import { toOgLocale } from './utils/to-og-locale.js';
|
|
9
9
|
|
|
10
|
-
function createBuildArticleMetadata(siteConfig, storageUrl) {
|
|
10
|
+
function createBuildArticleMetadata(siteConfig, urls, storageUrl) {
|
|
11
11
|
return function buildArticleMetadata(post, locale) {
|
|
12
12
|
const { defaultLocale, locales, siteUrl, siteName, siteDescription } = siteConfig;
|
|
13
13
|
const resolvedLocale = locale ?? defaultLocale;
|
|
@@ -32,9 +32,10 @@ function createBuildArticleMetadata(siteConfig, storageUrl) {
|
|
|
32
32
|
}
|
|
33
33
|
],
|
|
34
34
|
// url
|
|
35
|
+
// url
|
|
35
36
|
alternates: {
|
|
36
|
-
canonical: seoMetadata.canonical,
|
|
37
|
-
languages: buildAlternateMap(seoMetadata.alternate)
|
|
37
|
+
canonical: seoMetadata.canonical ?? urls.canonical,
|
|
38
|
+
languages: seoMetadata.alternate?.length ? buildAlternateMap(seoMetadata.alternate) : urls.alternates
|
|
38
39
|
},
|
|
39
40
|
// robots
|
|
40
41
|
robots: seoMetadata.robots || {
|
|
@@ -6,7 +6,7 @@ import { ensureTwitterCard } from './utils/ensure-twitter-card.js';
|
|
|
6
6
|
import { sanitizeStringArray } from './utils/sanitize-string-array.js';
|
|
7
7
|
import { toOgLocale } from './utils/to-og-locale.js';
|
|
8
8
|
|
|
9
|
-
function createBuildWebsiteMetadata(siteConfig) {
|
|
9
|
+
function createBuildWebsiteMetadata(siteConfig, urls) {
|
|
10
10
|
return function buildWebsiteMetadata(post, locale) {
|
|
11
11
|
const {
|
|
12
12
|
defaultLocale,
|
|
@@ -27,8 +27,8 @@ function createBuildWebsiteMetadata(siteConfig) {
|
|
|
27
27
|
description: seoMetadata.description || siteDescription[resolvedLocale],
|
|
28
28
|
// url
|
|
29
29
|
alternates: {
|
|
30
|
-
canonical: seoMetadata.canonical,
|
|
31
|
-
languages: buildAlternateMap(seoMetadata.alternate)
|
|
30
|
+
canonical: seoMetadata.canonical ?? urls.canonical,
|
|
31
|
+
languages: seoMetadata.alternate?.length ? buildAlternateMap(seoMetadata.alternate) : urls.alternates
|
|
32
32
|
},
|
|
33
33
|
// robots
|
|
34
34
|
robots: seoMetadata.robots || {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { SiteConfig } from "../../domain";
|
|
2
2
|
import type { PostFull } from "../../domain/resources/post/full";
|
|
3
3
|
import type { Metadata } from "next";
|
|
4
|
-
export declare function createBuildArticleMetadata<Locale extends string = string>(siteConfig: SiteConfig<Locale>,
|
|
4
|
+
export declare function createBuildArticleMetadata<Locale extends string = string>(siteConfig: SiteConfig<Locale>, urls: {
|
|
5
|
+
canonical: string;
|
|
6
|
+
alternates: Record<string, string>;
|
|
7
|
+
}, storageUrl: string): (post?: PostFull, locale?: Locale) => Metadata;
|
|
5
8
|
//# sourceMappingURL=build-article-metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-article-metadata.d.ts","sourceRoot":"","sources":["../../../../../src/shared/seo-metadata/build-article-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAUrC,wBAAgB,0BAA0B,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,EACvE,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,EAC9B,UAAU,EAAE,MAAM,IAGhB,OAAO,QAAQ,EACf,SAAS,MAAM,KACd,QAAQ,
|
|
1
|
+
{"version":3,"file":"build-article-metadata.d.ts","sourceRoot":"","sources":["../../../../../src/shared/seo-metadata/build-article-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAUrC,wBAAgB,0BAA0B,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,EACvE,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,EAC9B,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,EAC/D,UAAU,EAAE,MAAM,IAGhB,OAAO,QAAQ,EACf,SAAS,MAAM,KACd,QAAQ,CAmGZ"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { SiteConfig } from "../../domain";
|
|
2
2
|
import type { PostFull } from "../../domain/resources/post/full";
|
|
3
3
|
import type { Metadata } from "next";
|
|
4
|
-
export declare function createBuildWebsiteMetadata<Locale extends string = string>(siteConfig: SiteConfig<Locale
|
|
4
|
+
export declare function createBuildWebsiteMetadata<Locale extends string = string>(siteConfig: SiteConfig<Locale>, urls: {
|
|
5
|
+
canonical: string;
|
|
6
|
+
alternates: Record<string, string>;
|
|
7
|
+
}): (post?: PostFull, locale?: Locale) => Metadata;
|
|
5
8
|
//# sourceMappingURL=build-website-metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-website-metadata.d.ts","sourceRoot":"","sources":["../../../../../src/shared/seo-metadata/build-website-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AASrC,wBAAgB,0BAA0B,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,EACvE,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"build-website-metadata.d.ts","sourceRoot":"","sources":["../../../../../src/shared/seo-metadata/build-website-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AASrC,wBAAgB,0BAA0B,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,EACvE,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,EAC9B,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,IAG7D,OAAO,QAAQ,EACf,SAAS,MAAM,KACd,QAAQ,CAmFZ"}
|