@fullstackdatasolutions/articles 1.3.0 → 1.3.1
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 +6 -0
- package/dist/nextjs.cjs +5 -20
- package/dist/nextjs.cjs.map +1 -1
- package/dist/nextjs.js +5 -20
- package/dist/nextjs.js.map +1 -1
- package/dist/server.cjs +5 -3
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +5 -3
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/server-articles.test.ts +21 -0
- package/src/server-articles.ts +10 -1
package/dist/server.js
CHANGED
|
@@ -1052,11 +1052,13 @@ function getArticleMarkdownResponse(slug, config, options) {
|
|
|
1052
1052
|
const article = yield getArticleMetadata(slug, config);
|
|
1053
1053
|
reportAiCrawl(slug, config, options == null ? void 0 : options.headers);
|
|
1054
1054
|
const body = article && config.markdownTwinHeader !== false ? `${buildMarkdownTwinHeader(article, config, markdown)}${markdown.trimStart()}` : markdown;
|
|
1055
|
+
const canonicalUrl = `${config.siteUrl.replace(/\/$/, "")}/articles/${slug}`;
|
|
1055
1056
|
return new Response(body, {
|
|
1056
|
-
headers:
|
|
1057
|
+
headers: {
|
|
1057
1058
|
"Content-Type": "text/markdown; charset=utf-8",
|
|
1058
|
-
"Cache-Control": "public, max-age=3600, s-maxage=3600"
|
|
1059
|
-
|
|
1059
|
+
"Cache-Control": "public, max-age=3600, s-maxage=3600",
|
|
1060
|
+
Link: `<${canonicalUrl}>; rel="canonical"`
|
|
1061
|
+
}
|
|
1060
1062
|
});
|
|
1061
1063
|
});
|
|
1062
1064
|
}
|