From 4228417cdf7eec2a895fe5db1d65f048f5a5b546 Mon Sep 17 00:00:00 2001 From: Pavel Zhukov <33721692+LeaveMyYard@users.noreply.github.com> Date: Mon, 16 Oct 2023 18:17:52 +0300 Subject: [PATCH] More algolia improvements (#1096) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Increase the font for algolia results * Trim ΒΆ sign from search results * Increase search CSS size --- docs/_static/custom.css | 12 ++++++++++++ docs/crawler.js | 20 ++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/docs/_static/custom.css b/docs/_static/custom.css index 548b9c476..9d5aea189 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -283,4 +283,16 @@ h2, h3 { .sd-tab-set>label { font-size: 16px; +} + +.DocSearch-Hit-source { + font-size: 1.25em !important; +} + +.DocSearch-Hit-title { + font-size: 1.10em !important; +} + +.DocSearch-Hit-path { + font-size: 1em !important; } \ No newline at end of file diff --git a/docs/crawler.js b/docs/crawler.js index 63570ce55..6cf209341 100644 --- a/docs/crawler.js +++ b/docs/crawler.js @@ -14,11 +14,10 @@ new Crawler({ indexName: "robusta", pathsToMatch: ["https://docs.robusta.dev/master/**"], recordExtractor: ({ helpers, url }) => { - return helpers.docsearch( - url.pathname.includes("/triggers/") - ? { - recordProps: url.pathname.includes("/triggers/") - ? { + return helpers + .docsearch({ + recordProps: url.pathname.includes("/triggers/") + ? { lvl0: { selectors: [], defaultValue: "Triggers", @@ -27,7 +26,9 @@ new Crawler({ lvl2: ["details summary"], content: ["details *:not(summary)"], pageRank: 9, - } : url.pathname.includes("/actions/") ? { + } + : url.pathname.includes("/actions/") + ? { lvl0: { selectors: [], defaultValue: "Actions", @@ -36,7 +37,9 @@ new Crawler({ lvl2: [".admonition .admonition-title"], content: [".admonition *:not(.admonition-title)"], pageRank: 8, - } : url.pathname.includes("/sinks/") ? { + } + : url.pathname.includes("/sinks/") + ? { lvl0: { selectors: [], defaultValue: "Sinks", @@ -48,7 +51,8 @@ new Crawler({ lvl5: ["article h5", "h5"], content: ["article p, article li, article code"], pageRank: 7, - } : { + } + : { lvl0: { selectors: ["article h1", "head > title"], defaultValue: "Documentation",