Skip to content

Commit eb61383

Browse files
authored
fix: add documentation to Google Search (#65)
1 parent 88e89d2 commit eb61383

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

.vitepress/config.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const env = envVar.from(process.env);
1212

1313
const urlBase = env.get("DOCS_URL_BASE").asString();
1414
const packageVersion = env.get("DOCS_PACKAGE_VERSION").default(packageJson.version).asString();
15+
const googleSiteVerificationCode = "7b4Hd_giIK0EFsin6a7PWLmM_OeaC7APLZUxVGwwI6Y";
1516

1617
const chatWrappersOrder = [
1718
"GeneralChatPromptWrapper",
@@ -43,7 +44,19 @@ export default defineConfig({
4344

4445
base: urlBase,
4546
sitemap: {
46-
hostname: "https://withcatai.github.io/node-llama-cpp/"
47+
hostname: "https://withcatai.github.io/node-llama-cpp/",
48+
transformItems(items) {
49+
return items.map((item) => {
50+
if (item.url.includes("api/") || item.url.includes("guide/cli/")) {
51+
item = {
52+
...item,
53+
lastmod: undefined,
54+
}
55+
}
56+
57+
return item;
58+
});
59+
}
4760
},
4861
head: [
4962
["link", {rel: "icon", type: "image/svg+xml", href: resolveHref("/favicon.svg")}],
@@ -54,6 +67,11 @@ export default defineConfig({
5467
["meta", {name: "og:locale", content: "en"}],
5568
["meta", {name: "og:site_name", content: "node-llama-cpp"}]
5669
],
70+
transformHead({pageData, head}) {
71+
if (pageData.filePath === "index.md") {
72+
head.push(["meta", {name: "google-site-verification", content: googleSiteVerificationCode}]);
73+
}
74+
},
5775
transformPageData(pageData) {
5876
if (pageData.filePath.startsWith("api/") || pageData.filePath.startsWith("guide/cli/")) {
5977
pageData.frontmatter.editLink = false;
@@ -62,7 +80,7 @@ export default defineConfig({
6280
},
6381
themeConfig: {
6482
editLink: {
65-
pattern: "https://github.com/withcatai/node-llama-cpp/edit/main/docs/:path"
83+
pattern: "https://github.com/withcatai/node-llama-cpp/edit/master/docs/:path"
6684
},
6785
nav: [
6886
{text: "Guide", link: "/guide/", activeMatch: "/guide/"},

src/cli/commands/DownloadCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const DownloadCommand: CommandModule<object, DownloadCommandArgs> = {
7676
alias: "nb",
7777
type: "boolean",
7878
default: false,
79-
description: "Download a llama.cpp only from GitHub, even if a local git bundle exists for the release"
79+
description: "Download a llama.cpp release only from GitHub, even if a local git bundle exists for the release"
8080
})
8181
.option("updateBinariesReleaseMetadataAndSaveGitBundle", {
8282
type: "boolean",

0 commit comments

Comments
 (0)