From 10294207c26bcd6eb535687b1d380bfb60456e3b Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Wed, 29 Jan 2025 14:33:45 -0800 Subject: [PATCH] Apply canonicals for integrations --- docs/core_docs/src/theme/SiteMetadata/index.js | 11 +++++++++-- libs/langchain-community/src/indexes/sqlite.ts | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/core_docs/src/theme/SiteMetadata/index.js b/docs/core_docs/src/theme/SiteMetadata/index.js index b06b24c68f31..ee2b6438c7d2 100644 --- a/docs/core_docs/src/theme/SiteMetadata/index.js +++ b/docs/core_docs/src/theme/SiteMetadata/index.js @@ -65,7 +65,14 @@ function useDefaultCanonicalUrl() { }); const canonicalPathnameNoVersion = canonicalPathname.startsWith('/v0.') ? "/"+canonicalPathname.split('/').slice(2).join('/') : canonicalPathname; const suggestedLookup = suggestedLinks[canonicalPathnameNoVersion]; - const finalPathname = suggestedLookup?.canonical || canonicalPathname; + let finalPathname; + if (suggestedLookup?.canonical) { + finalPathname = suggestedLookup.canonical; + } else if (canonicalPathnameNoVersion.startsWith("/docs/integrations/")) { + finalPathname = canonicalPathnameNoVersion; + } else { + finalPathname = canonicalPathname; + } if (finalPathname.startsWith("https://")) { return finalPathname; } @@ -280,7 +287,7 @@ const suggestedLinks = { ] }, "/docs/get_started/installation/": { - "canonical": "/docs/tutorials/", + "canonical": "/docs/how_to/installation/", "alternative": [ "/v0.1/docs/get_started/installation/" ] diff --git a/libs/langchain-community/src/indexes/sqlite.ts b/libs/langchain-community/src/indexes/sqlite.ts index 78d7f8faf34b..720faf16aca0 100644 --- a/libs/langchain-community/src/indexes/sqlite.ts +++ b/libs/langchain-community/src/indexes/sqlite.ts @@ -1,3 +1,5 @@ +// eslint-disable-next-line ban-ts-comment +// @ts-nocheck // eslint-disable-next-line import/no-extraneous-dependencies import Database, { Database as DatabaseType, Statement } from "better-sqlite3"; import {