@farming-labs/nuxt-theme 0.1.76 → 0.1.78
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/nuxt-theme",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.78",
|
|
4
4
|
"description": "Nuxt/Vue UI components for @farming-labs/docs — layout, sidebar, TOC, search, and theme toggle",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"sugar-high": "^0.9.5",
|
|
91
|
-
"@farming-labs/docs": "0.1.
|
|
91
|
+
"@farming-labs/docs": "0.1.78"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"nuxt": ">=3.0.0",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed, ref, onMounted, onUnmounted, watch } from "vue";
|
|
3
3
|
import { useRoute } from "vue-router";
|
|
4
4
|
import { useHead } from "#app";
|
|
5
|
+
import { toDocsMarkdownUrl } from "@farming-labs/docs";
|
|
5
6
|
import DocsPage from "./DocsPage.vue";
|
|
6
7
|
|
|
7
8
|
const DEFAULT_OPEN_PROVIDERS = [
|
|
@@ -12,6 +13,7 @@ const DEFAULT_OPEN_PROVIDERS = [
|
|
|
12
13
|
const props = defineProps<{
|
|
13
14
|
data: {
|
|
14
15
|
title: string;
|
|
16
|
+
url?: string;
|
|
15
17
|
description?: string;
|
|
16
18
|
html: string;
|
|
17
19
|
rawMarkdown?: string;
|
|
@@ -88,6 +90,12 @@ const llmsTxtEnabled = computed(() => {
|
|
|
88
90
|
});
|
|
89
91
|
|
|
90
92
|
const entry = computed(() => (props.data.entry as string) ?? (props.config?.entry as string) ?? "docs");
|
|
93
|
+
const pageUrl = computed(() =>
|
|
94
|
+
props.data.url ?? `/${entry.value}${props.data.slug ? `/${props.data.slug}` : ""}`,
|
|
95
|
+
);
|
|
96
|
+
const markdownAlternateHref = computed(() =>
|
|
97
|
+
props.config?.staticExport ? null : toDocsMarkdownUrl(pageUrl.value, { locale: props.data.locale }),
|
|
98
|
+
);
|
|
91
99
|
|
|
92
100
|
const copyMarkdownEnabled = computed(() => {
|
|
93
101
|
const pa = props.config?.pageActions as Record<string, unknown> | undefined;
|
|
@@ -227,6 +235,10 @@ useHead({
|
|
|
227
235
|
title: () => `${props.data.title}${titleSuffix.value}`,
|
|
228
236
|
meta: () =>
|
|
229
237
|
metaDescription.value ? [{ name: "description", content: metaDescription.value }] : [],
|
|
238
|
+
link: () =>
|
|
239
|
+
markdownAlternateHref.value
|
|
240
|
+
? [{ rel: "alternate", type: "text/markdown", href: markdownAlternateHref.value }]
|
|
241
|
+
: [],
|
|
230
242
|
});
|
|
231
243
|
|
|
232
244
|
function handleCopyPage() {
|