@riebeckite/plugin-seo 0.0.17 → 0.0.19
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 -1
- package/README_ja.md +1 -1
- package/dist/index.js +7 -3
- package/dist/src/metadata.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
package/README_ja.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -133,7 +133,7 @@ function getResolvedFeedMetadata(config) {
|
|
|
133
133
|
|
|
134
134
|
// src/metadata.ts
|
|
135
135
|
import { calculateReadingTime } from "@riebeckite/core";
|
|
136
|
-
function buildArticleSeo(config, permalink, post, headTags) {
|
|
136
|
+
function buildArticleSeo(config, permalink, post, headTags, language) {
|
|
137
137
|
const siteName = config.site.title;
|
|
138
138
|
const title = getArticleTitle(config, permalink, post.frontmatter.title);
|
|
139
139
|
const canonicalUrl = buildCanonicalUrl(
|
|
@@ -166,7 +166,7 @@ function buildArticleSeo(config, permalink, post, headTags) {
|
|
|
166
166
|
publisher: { "@type": "Organization", name: siteName },
|
|
167
167
|
keywords: tags.length > 0 ? tags.join(", ") : void 0,
|
|
168
168
|
timeRequired: readingTimeMinutes ? `PT${readingTimeMinutes}M` : void 0,
|
|
169
|
-
inLanguage:
|
|
169
|
+
inLanguage: resolveInLanguage(config, language)
|
|
170
170
|
})
|
|
171
171
|
];
|
|
172
172
|
if (!hasBreadcrumbListHeadTag(headTags)) {
|
|
@@ -225,6 +225,10 @@ function buildWebsiteSeo(config, input, headTags) {
|
|
|
225
225
|
jsonLd
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
|
+
function resolveInLanguage(config, language) {
|
|
229
|
+
const value = language?.trim();
|
|
230
|
+
return value ? value.replace("_", "-") : getHtmlLanguage(config);
|
|
231
|
+
}
|
|
228
232
|
function buildCanonicalUrl(config, canonical, permalink) {
|
|
229
233
|
if (typeof canonical === "string" && canonical.trim()) {
|
|
230
234
|
return buildAbsoluteUrl(config, canonical.trim());
|
|
@@ -377,7 +381,7 @@ function seo(options = {}) {
|
|
|
377
381
|
name: "seo",
|
|
378
382
|
options,
|
|
379
383
|
seo: {
|
|
380
|
-
buildArticleSeo: (config, permalink, post, headTags) => buildArticleSeo(config, permalink, post, headTags),
|
|
384
|
+
buildArticleSeo: (config, permalink, post, headTags, language) => buildArticleSeo(config, permalink, post, headTags, language),
|
|
381
385
|
buildWebsiteSeo: (config, input, headTags) => buildWebsiteSeo(config, input, headTags),
|
|
382
386
|
buildAbsoluteUrl,
|
|
383
387
|
buildPostUrl,
|
package/dist/src/metadata.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { PluginHeadTag, PostContent, ResolvedRiebeckiteConfig, SeoMetadata, WebsiteSeoInput } from "@riebeckite/core";
|
|
2
|
-
export declare function buildArticleSeo(config: ResolvedRiebeckiteConfig, permalink: string, post: PostContent, headTags?: readonly PluginHeadTag[]): SeoMetadata;
|
|
2
|
+
export declare function buildArticleSeo(config: ResolvedRiebeckiteConfig, permalink: string, post: PostContent, headTags?: readonly PluginHeadTag[], language?: string): SeoMetadata;
|
|
3
3
|
export declare function buildWebsiteSeo(config: ResolvedRiebeckiteConfig, input: WebsiteSeoInput, headTags?: readonly PluginHeadTag[]): SeoMetadata;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-seo",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@riebeckite/core": "0.0.
|
|
17
|
+
"@riebeckite/core": "0.0.19"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"tsx": "^4.22.4",
|
|
21
|
-
"@riebeckite/test": "0.0.
|
|
21
|
+
"@riebeckite/test": "0.0.19"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|