@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 CHANGED
@@ -110,4 +110,4 @@ shared limit for RSS, Atom, and JSON Feed.
110
110
 
111
111
  ## See also
112
112
 
113
- - [Plugin guide](../../../docs/en/docs/reference/plugin-api.md)
113
+ - [Plugin guide](../../../docs/docs/reference/plugin-api.en.md)
package/README_ja.md CHANGED
@@ -61,4 +61,4 @@ export default defineConfig({
61
61
 
62
62
  ## 関連資料
63
63
 
64
- - [プラグインシステム](../../../docs/ja/docs/reference/plugin-api.md)
64
+ - [プラグインシステム](../../../docs/docs/reference/plugin-api.md)
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: getHtmlLanguage(config)
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,
@@ -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.17",
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"
17
+ "@riebeckite/core": "0.0.19"
18
18
  },
19
19
  "devDependencies": {
20
20
  "tsx": "^4.22.4",
21
- "@riebeckite/test": "0.0.17"
21
+ "@riebeckite/test": "0.0.19"
22
22
  },
23
23
  "publishConfig": {
24
24
  "access": "public"