From e58e016c35b9b1dadd3163c1b7b8b52e19e26b40 Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Wed, 8 Oct 2025 17:29:56 -0600 Subject: [PATCH 1/3] enh: add algolia search --- _config.yml | 15 +- _includes/search/algolia-search-scripts.html | 222 ++++++++++++++----- 2 files changed, 173 insertions(+), 64 deletions(-) diff --git a/_config.yml b/_config.yml index 59cc343d..cf23e316 100644 --- a/_config.yml +++ b/_config.yml @@ -73,12 +73,12 @@ atom_feed: path: # blank (default) uses feed.xml search: true #true # true, false (default) search_full_content: # true, false (default) -search_provider: # lunr (default), algolia, google +search_provider: algolia # lunr (default), algolia, google algolia: - application_id: # YOUR_APPLICATION_ID - index_name: # YOUR_INDEX_NAME - search_only_api_key: # YOUR_SEARCH_ONLY_API_KEY - powered_by: # true (default), false + application_id: OCL08AWWSO # YOUR_APPLICATION_ID + index_name: pyopensci # YOUR_INDEX_NAME + search_only_api_key: 42e1fb9616225e65d332af46f27dba9f # YOUR_SEARCH_ONLY_API_KEY + powered_by: true # true (default), false google: search_engine_id: # YOUR_SEARCH_ENGINE_ID instant_search: # false (default), true @@ -91,10 +91,7 @@ naver_site_verification: # Social Sharing twitter: username: -facebook: - username: - app_id: - publisher: + og_image: # Open Graph/Twitter default site image # For specifying social profiles # - https://developers.google.com/structured-data/customize/social-profiles diff --git a/_includes/search/algolia-search-scripts.html b/_includes/search/algolia-search-scripts.html index 5b285b2b..d4b3b7b7 100644 --- a/_includes/search/algolia-search-scripts.html +++ b/_includes/search/algolia-search-scripts.html @@ -1,62 +1,174 @@ - - - - - + + + From 8d5f70942ed41fe76f97adaa9843571f8a59eefd Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Mon, 20 Oct 2025 20:52:12 -0700 Subject: [PATCH 2/3] Algolia awesomeness --- _includes/search/algolia-search-scripts.html | 10 +++---- _includes/search/google-search-scripts.html | 30 -------------------- _includes/search/lunr-search-scripts.html | 10 ------- 3 files changed, 5 insertions(+), 45 deletions(-) delete mode 100644 _includes/search/google-search-scripts.html delete mode 100644 _includes/search/lunr-search-scripts.html diff --git a/_includes/search/algolia-search-scripts.html b/_includes/search/algolia-search-scripts.html index d4b3b7b7..f3b94a19 100644 --- a/_includes/search/algolia-search-scripts.html +++ b/_includes/search/algolia-search-scripts.html @@ -78,19 +78,19 @@ if (!url) return 'Page'; // Normalize once (strip base domain if present) const lower = url.toLowerCase(); - if (lower.includes('/lessons/')) return 'Lesson'; + if (lower.includes('python-package-guide/tutorials/')) return 'Tutorial'; + if (lower.includes('/lessons/')) return 'Tutorial'; if (lower.includes('/python-package-guide/') || lower.includes('/packaging-guide/')) return 'Packaging Guide'; - if (lower.includes('/peer-review-guide/')) return 'Peer Review'; + if (lower.includes('/software-peer-review/')) return 'Peer Review Guide'; if (lower.includes('/handbook/')) return 'Handbook'; if (lower.includes('/metrics/')) return 'Metrics'; - if (lower.includes('/tutorial')) return 'Tutorial'; if (lower.includes('/events/') || lower.includes('/event/')) return 'Event'; if (lower.includes('/blog/') || lower.includes('/posts/')) return 'Blog'; if (lower.includes('/docs/') || lower.includes('/guide/')) return 'Docs'; - return 'Page'; + return 'Website'; } - // Simplified single-row template (avoids theme grid classes) + // Return results in a single easy to read column const hitTemplate = function(hit) { const title = resolveTitle(hit); const snippet = resolveSnippet(hit); diff --git a/_includes/search/google-search-scripts.html b/_includes/search/google-search-scripts.html deleted file mode 100644 index 85faca16..00000000 --- a/_includes/search/google-search-scripts.html +++ /dev/null @@ -1,30 +0,0 @@ - diff --git a/_includes/search/lunr-search-scripts.html b/_includes/search/lunr-search-scripts.html deleted file mode 100644 index 4f11775e..00000000 --- a/_includes/search/lunr-search-scripts.html +++ /dev/null @@ -1,10 +0,0 @@ -{% assign lang = site.locale | slice: 0,2 | default: "en" %} -{% case lang %} -{% when "gr" %} - {% assign lang = "gr" %} -{% else %} - {% assign lang = "en" %} -{% endcase %} - - - From fdd89dcd8db6da8eaa853def69fc40deef261d85 Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Mon, 20 Oct 2025 20:52:21 -0700 Subject: [PATCH 3/3] sdf --- _includes/search/algolia-search-scripts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/search/algolia-search-scripts.html b/_includes/search/algolia-search-scripts.html index f3b94a19..30aaf983 100644 --- a/_includes/search/algolia-search-scripts.html +++ b/_includes/search/algolia-search-scripts.html @@ -90,7 +90,7 @@ return 'Website'; } - // Return results in a single easy to read column + // Return results in a single easy to read column const hitTemplate = function(hit) { const title = resolveTitle(hit); const snippet = resolveSnippet(hit);