From befcbcdd5d940b60b3e62a1ccce74dc56f234141 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Tue, 21 Nov 2023 02:06:00 -0800 Subject: [PATCH] Use file source to find entries from github, notion on web, desktop client This is a more robust mechanism of identification than via file name including github or notion domain names --- src/interface/desktop/search.html | 6 +++--- src/khoj/interface/web/search.html | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/interface/desktop/search.html b/src/interface/desktop/search.html index aa8aa662..ce368b9b 100644 --- a/src/interface/desktop/search.html +++ b/src/interface/desktop/search.html @@ -112,14 +112,14 @@ } else if ( item.additional.file.endsWith(".md") || item.additional.file.endsWith(".markdown") || - (item.additional.file.includes("issues") && item.additional.file.includes("github.com")) || - (item.additional.file.includes("commit") && item.additional.file.includes("github.com")) + (item.additional.file.includes("issues") && item.additional.source === "github") || + (item.additional.file.includes("commit") && item.additional.source === "github") ) { html += render_markdown(query, [item]); } else if (item.additional.file.endsWith(".pdf")) { html += render_pdf(query, [item]); - } else if (item.additional.file.includes("notion.so")) { + } else if (item.additional.source == "notion") { html += `
` + `${item.additional.heading}` + `

${item.entry}

` + `
`; } else if (item.additional.file.endsWith(".html")) { html += render_html(query, [item]); diff --git a/src/khoj/interface/web/search.html b/src/khoj/interface/web/search.html index 5331ea92..d3ddb595 100644 --- a/src/khoj/interface/web/search.html +++ b/src/khoj/interface/web/search.html @@ -112,14 +112,14 @@ } else if ( item.additional.file.endsWith(".md") || item.additional.file.endsWith(".markdown") || - (item.additional.file.includes("issues") && item.additional.file.includes("github.com")) || - (item.additional.file.includes("commit") && item.additional.file.includes("github.com")) + (item.additional.file.includes("issues") && item.additional.source === "github") || + (item.additional.file.includes("commit") && item.additional.source === "github") ) { html += render_markdown(query, [item]); } else if (item.additional.file.endsWith(".pdf")) { html += render_pdf(query, [item]); - } else if (item.additional.file.includes("notion.so")) { + } else if (item.additional.source === "notion") { html += `
` + `${item.additional.heading}` + `

${item.entry}

` + `
`; } else if (item.additional.file.endsWith(".html")) { html += render_html(query, [item]);