@windrun-huaiin/third-ui 5.12.3 → 5.13.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/fuma/server.d.mts +12 -1
- package/dist/fuma/server.d.ts +12 -1
- package/dist/fuma/server.js +20 -4
- package/dist/fuma/server.js.map +1 -1
- package/dist/fuma/server.mjs +20 -4
- package/dist/fuma/server.mjs.map +1 -1
- package/dist/lib/server.d.mts +33 -1
- package/dist/lib/server.d.ts +33 -1
- package/dist/lib/server.js +75 -0
- package/dist/lib/server.js.map +1 -1
- package/dist/lib/server.mjs +61 -0
- package/dist/lib/server.mjs.map +1 -1
- package/package.json +1 -1
- package/src/fuma/fuma-page-genarator.tsx +30 -3
- package/src/lib/seo-util.ts +107 -0
- package/src/lib/server.ts +2 -1
package/dist/fuma/server.mjs
CHANGED
|
@@ -9529,7 +9529,8 @@ function createFumaPage({
|
|
|
9529
9529
|
githubBaseUrl,
|
|
9530
9530
|
copyButtonComponent,
|
|
9531
9531
|
siteIcon,
|
|
9532
|
-
FallbackPage
|
|
9532
|
+
FallbackPage,
|
|
9533
|
+
supportedLocales = ["en"]
|
|
9533
9534
|
}) {
|
|
9534
9535
|
const Page = function Page2(_0) {
|
|
9535
9536
|
return __async(this, arguments, function* ({ params }) {
|
|
@@ -9571,17 +9572,32 @@ function createFumaPage({
|
|
|
9571
9572
|
}
|
|
9572
9573
|
function generateMetadata(props) {
|
|
9573
9574
|
return __async(this, null, function* () {
|
|
9574
|
-
const
|
|
9575
|
-
const page = mdxContentSource.getPage(
|
|
9575
|
+
const { slug, locale } = yield props.params;
|
|
9576
|
+
const page = mdxContentSource.getPage(slug, locale);
|
|
9576
9577
|
if (!page) {
|
|
9577
9578
|
return {
|
|
9578
9579
|
title: "404 - Page Not Found",
|
|
9579
9580
|
description: "This page could not be found."
|
|
9580
9581
|
};
|
|
9581
9582
|
}
|
|
9583
|
+
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL;
|
|
9584
|
+
const baseRoute = mdxSourceDir.replace("src/mdx/", "");
|
|
9585
|
+
const currentPath = slug ? slug.join("/") : "";
|
|
9586
|
+
const currentUrl = `${baseUrl}/${locale}/${baseRoute}${currentPath ? `/${currentPath}` : ""}`;
|
|
9587
|
+
const seoLanguageMap = {};
|
|
9588
|
+
console.log("supportedLocales", supportedLocales);
|
|
9589
|
+
supportedLocales.forEach((loc) => {
|
|
9590
|
+
seoLanguageMap[loc] = `${baseUrl}/${loc}/${baseRoute}${currentPath ? `/${currentPath}` : ""}`;
|
|
9591
|
+
});
|
|
9592
|
+
console.log("seoLanguageMap", seoLanguageMap);
|
|
9582
9593
|
return {
|
|
9594
|
+
metadataBase: new URL(baseUrl),
|
|
9583
9595
|
title: page.data.title,
|
|
9584
|
-
description: page.data.description
|
|
9596
|
+
description: page.data.description,
|
|
9597
|
+
alternates: {
|
|
9598
|
+
canonical: currentUrl,
|
|
9599
|
+
languages: seoLanguageMap
|
|
9600
|
+
}
|
|
9585
9601
|
};
|
|
9586
9602
|
});
|
|
9587
9603
|
}
|