@farming-labs/svelte-theme 0.1.77 → 0.1.80

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/svelte-theme",
3
- "version": "0.1.77",
3
+ "version": "0.1.80",
4
4
  "description": "Svelte UI components for @farming-labs/docs — layout, sidebar, TOC, search, and theme toggle",
5
5
  "keywords": [
6
6
  "docs",
@@ -122,8 +122,8 @@
122
122
  "dependencies": {
123
123
  "gray-matter": "^4.0.3",
124
124
  "sugar-high": "^0.9.5",
125
- "@farming-labs/svelte": "0.1.77",
126
- "@farming-labs/docs": "0.1.77"
125
+ "@farming-labs/docs": "0.1.80",
126
+ "@farming-labs/svelte": "0.1.80"
127
127
  },
128
128
  "peerDependencies": {
129
129
  "svelte": ">=5.0.0"
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  import DocsPage from "./DocsPage.svelte";
3
3
  import { onMount, onDestroy } from "svelte";
4
+ import { toDocsMarkdownUrl } from "@farming-labs/docs";
4
5
 
5
6
  const DEFAULT_OPEN_PROVIDERS = [
6
7
  { name: "ChatGPT", urlTemplate: "https://chatgpt.com/?hints=search&q=Read+{mdxUrl},+I+want+to+ask+questions+about+it." },
@@ -30,6 +31,14 @@
30
31
  (config?.theme?.ui?.layout?.toc?.style === "directional") ? "directional" : "default"
31
32
  );
32
33
 
34
+ let pageUrl = $derived(
35
+ data.url ?? `/${data.entry ?? config?.entry ?? "docs"}${data.slug ? `/${data.slug}` : ""}`
36
+ );
37
+
38
+ let markdownAlternateHref = $derived(
39
+ config?.staticExport ? null : toDocsMarkdownUrl(pageUrl, { locale: data.locale })
40
+ );
41
+
33
42
  let breadcrumbEnabled = $derived.by(() => {
34
43
  const bc = config?.breadcrumb;
35
44
  if (bc === undefined || bc === true) return true;
@@ -314,6 +323,9 @@
314
323
  {#if data.description}
315
324
  <meta name="description" content={data.description} />
316
325
  {/if}
326
+ {#if markdownAlternateHref}
327
+ <link rel="alternate" type="text/markdown" href={markdownAlternateHref} />
328
+ {/if}
317
329
  </svelte:head>
318
330
 
319
331
  <DocsPage