@farming-labs/svelte 0.1.131 → 0.1.133
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/server.js +7 -4
- package/package.json +2 -2
package/dist/server.js
CHANGED
|
@@ -623,6 +623,7 @@ export function createDocsServer(config = {}) {
|
|
|
623
623
|
: "Documentation";
|
|
624
624
|
const llmsTxtConfig = config.llmsTxt;
|
|
625
625
|
const llmsBaseUrl = typeof llmsTxtConfig === "object" ? (llmsTxtConfig.baseUrl ?? "") : "";
|
|
626
|
+
const markdownMetadataBaseUrl = resolveDocsMetadataBaseUrl(config);
|
|
626
627
|
const llmsTitle = typeof llmsTxtConfig === "object" ? (llmsTxtConfig.siteTitle ?? llmsSiteTitle) : llmsSiteTitle;
|
|
627
628
|
const llmsDesc = typeof llmsTxtConfig === "object" ? llmsTxtConfig.siteDescription : undefined;
|
|
628
629
|
const llmsEnabled = llmsTxtConfig !== false &&
|
|
@@ -661,9 +662,9 @@ export function createDocsServer(config = {}) {
|
|
|
661
662
|
return locale;
|
|
662
663
|
return i18n.defaultLocale;
|
|
663
664
|
}
|
|
664
|
-
function getMarkdownDocument(ctx, requestedPath) {
|
|
665
|
+
function getMarkdownDocument(ctx, requestedPath, origin) {
|
|
665
666
|
const page = findDocsMarkdownPage(entry, getSearchIndex(ctx), requestedPath);
|
|
666
|
-
return page ? renderDocsMarkdownDocument(page, { sitemap: config.sitemap }) : null;
|
|
667
|
+
return page ? renderDocsMarkdownDocument(page, { origin, sitemap: config.sitemap }) : null;
|
|
667
668
|
}
|
|
668
669
|
// ─── GET /api/docs?query=… | ?format=llms | ?format=llms-full ──
|
|
669
670
|
async function GET(event) {
|
|
@@ -822,10 +823,11 @@ export function createDocsServer(config = {}) {
|
|
|
822
823
|
return robotsResponse;
|
|
823
824
|
const markdownRequest = resolveDocsMarkdownRequest(entry, event.url, event.request);
|
|
824
825
|
if (markdownRequest) {
|
|
825
|
-
const
|
|
826
|
+
const markdownOrigin = markdownMetadataBaseUrl || event.url.origin;
|
|
827
|
+
const document = getMarkdownDocument(ctx, markdownRequest.requestedPath, markdownOrigin);
|
|
826
828
|
const varyHeader = getDocsMarkdownVaryHeader(event.request);
|
|
827
829
|
const canonicalLinkHeader = getDocsMarkdownCanonicalLinkHeader({
|
|
828
|
-
origin:
|
|
830
|
+
origin: markdownOrigin,
|
|
829
831
|
entry,
|
|
830
832
|
requestedPath: markdownRequest.requestedPath,
|
|
831
833
|
locale: ctx.locale,
|
|
@@ -850,6 +852,7 @@ export function createDocsServer(config = {}) {
|
|
|
850
852
|
return new Response(renderDocsMarkdownNotFound({
|
|
851
853
|
entry,
|
|
852
854
|
requestedPath: markdownRequest.requestedPath,
|
|
855
|
+
origin: markdownOrigin,
|
|
853
856
|
pages: getSearchIndex(ctx),
|
|
854
857
|
sitemap: config.sitemap,
|
|
855
858
|
}), {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/svelte",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.133",
|
|
4
4
|
"description": "SvelteKit adapter for @farming-labs/docs — content loading and navigation utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/node": "^22.10.0",
|
|
58
58
|
"typescript": "^5.9.3",
|
|
59
|
-
"@farming-labs/docs": "0.1.
|
|
59
|
+
"@farming-labs/docs": "0.1.133"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@farming-labs/docs": "*"
|