From cf2c48f0477b2e1e89853bd90072a90a0455e315 Mon Sep 17 00:00:00 2001 From: Vinoo Ganesh Date: Fri, 13 Feb 2026 14:18:10 -0500 Subject: [PATCH 1/2] Switch from Algolia DocSearch to Lunr offline search --- hugo.toml | 9 ++--- layouts/partials/scripts.html | 66 +++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 layouts/partials/scripts.html diff --git a/hugo.toml b/hugo.toml index ae94c744..99383135 100644 --- a/hugo.toml +++ b/hugo.toml @@ -103,18 +103,15 @@ github_branch = "production" # gcs_engine_id = "7e3f91e3eadecceaa" # Enable Lunr.js offline search -offlineSearch = false +offlineSearch = true +offlineSearchMaxResults = 25 +offlineSearchSummaryLength = 200 # Enable syntax highlighting and copy buttons on code blocks with Prism prism_syntax_highlighting = false # User interface configuration -[params.search.algolia] -appId = '399WOPSE6Q' -apiKey = '437a8e172549357b6ca768248caecff9' -indexName = 'parquet-apache' - [params.ui] # Set to true to disable breadcrumb navigation. breadcrumb_disable = false diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html new file mode 100644 index 00000000..15add9ed --- /dev/null +++ b/layouts/partials/scripts.html @@ -0,0 +1,66 @@ +{{/* + Project-level override of Docsy's layouts/_partials/scripts.html + + Why this file exists: + Removes the Algolia DocSearch JS block (cdn.jsdelivr.net) which is blocked + by Apache's CSP. Also removes the markmap-autoloader CDN reference since + markmap is not enabled on this site. + + See: https://github.com/apache/parquet-site/issues/163 +*/ -}} +{{ $needKaTeX := or .Params.math .Site.Params.katex.enable .Params.chem .Site.Params.chem (.Page.Store.Get "hasKaTeX") (.Page.Store.Get "hasmhchem") -}} +{{ $needmhchem := or .Params.chem .Site.Params.katex.mhchem.enable (.Page.Store.Get "hasmhchem") -}} + +{{/* markmap block removed — it loads from cdn.jsdelivr.net which is blocked + by Apache's CSP, and markmap is not enabled on this site anyway. */ -}} + +{{ if .Site.Params.plantuml.enable -}} + +{{ end -}} + +{{ if $needKaTeX -}} + {{ partial "scripts/katex.html" (dict "mhchem" $needmhchem) -}} +{{ end -}} + +{{ $jsBs := resources.Get "vendor/bootstrap/dist/js/bootstrap.bundle.js" -}} +{{ $jsBase := resources.Get "js/base.js" -}} +{{ $jsSearch := resources.Get "js/search.js" | resources.ExecuteAsTemplate "js/search.js" .Site.Home -}} +{{ $jsMarkmap := resources.Get "js/markmap.js" | resources.ExecuteAsTemplate "js/markmap.js" . -}} +{{ $jsPlantuml := resources.Get "js/plantuml.js" | resources.ExecuteAsTemplate "js/plantuml.js" . -}} +{{ $jsDrawio := resources.Get "js/drawio.js" | resources.ExecuteAsTemplate "js/drawio.js" . -}} +{{ if .Site.Params.offlineSearch -}} + {{ $jsSearch = resources.Get "js/offline-search.js" -}} +{{ end -}} + +{{ $jsArray := slice $jsBs $jsBase $jsSearch $jsPlantuml $jsMarkmap $jsDrawio -}} + +{{ if .Page.Store.Get "hasmermaid" -}} +{{- partial "scripts/mermaid.html" . -}} +{{ end -}} + +{{ if .Site.Params.ui.showLightDarkModeMenu -}} + {{ $jsArray = $jsArray | append (resources.Get "js/dark-mode.js") -}} +{{ end -}} + +{{ $js := $jsArray | resources.Concat "js/main.js" -}} +{{ if hugo.IsProduction -}} + {{ $js := $js | minify | fingerprint -}} + +{{ else -}} + +{{ end -}} + +{{ if .Site.Params.prism_syntax_highlighting -}} + +{{ else if ( not .Site.Params.disable_click2copy_chroma ) -}} + {{ $c2cJS := resources.Get "js/click-to-copy.js" -}} + {{ if hugo.IsProduction -}} + {{ $c2cJS = $c2cJS | minify | fingerprint -}} + {{ end -}} + +{{ end -}} + + +{{ partial "hooks/body-end.html" . -}} From eb7dec66fcab4cf2e01256511b86d32865775bc6 Mon Sep 17 00:00:00 2001 From: Vinoo Ganesh Date: Sun, 22 Feb 2026 16:28:08 -0500 Subject: [PATCH 2/2] Add missing title front matter so search results are clickable Pages with only linkTitle (no title) had empty .Title in Hugo, causing Lunr search results to render with no visible link text. --- content/en/docs/File Format/Data Pages/compression.md | 1 + content/en/docs/File Format/Data Pages/encodings.md | 1 + content/en/docs/File Format/Data Pages/encryption.md | 1 + content/en/docs/File Format/Types/Geospatial.md | 1 + content/en/docs/File Format/Types/VariantEncoding.md | 1 + content/en/docs/File Format/Types/VariantShredding.md | 1 + content/en/docs/File Format/Types/logicaltypes.md | 1 + content/en/docs/File Format/binaryprotocolextensions.md | 1 + content/en/docs/File Format/bloomfilter.md | 1 + content/en/docs/File Format/pageindex.md | 1 + 10 files changed, 10 insertions(+) diff --git a/content/en/docs/File Format/Data Pages/compression.md b/content/en/docs/File Format/Data Pages/compression.md index 7210d167..1a205dc9 100644 --- a/content/en/docs/File Format/Data Pages/compression.md +++ b/content/en/docs/File Format/Data Pages/compression.md @@ -1,4 +1,5 @@ --- +title: "Compression" linkTitle: "Compression" weight: 1 --- diff --git a/content/en/docs/File Format/Data Pages/encodings.md b/content/en/docs/File Format/Data Pages/encodings.md index 7bba6f96..5b4d35cb 100644 --- a/content/en/docs/File Format/Data Pages/encodings.md +++ b/content/en/docs/File Format/Data Pages/encodings.md @@ -1,4 +1,5 @@ --- +title: "Encodings" linkTitle: "Encodings" weight: 1 --- diff --git a/content/en/docs/File Format/Data Pages/encryption.md b/content/en/docs/File Format/Data Pages/encryption.md index 4cee0ed4..1b890738 100644 --- a/content/en/docs/File Format/Data Pages/encryption.md +++ b/content/en/docs/File Format/Data Pages/encryption.md @@ -1,4 +1,5 @@ --- +title: "Encryption" linkTitle: "Encryption" weight: 1 --- diff --git a/content/en/docs/File Format/Types/Geospatial.md b/content/en/docs/File Format/Types/Geospatial.md index 9b348b49..5570fda4 100644 --- a/content/en/docs/File Format/Types/Geospatial.md +++ b/content/en/docs/File Format/Types/Geospatial.md @@ -1,4 +1,5 @@ --- +title: "Geospatial Type" linkTitle: "Geospatial Type" weight: 5 --- diff --git a/content/en/docs/File Format/Types/VariantEncoding.md b/content/en/docs/File Format/Types/VariantEncoding.md index c3491d66..e3e66af7 100644 --- a/content/en/docs/File Format/Types/VariantEncoding.md +++ b/content/en/docs/File Format/Types/VariantEncoding.md @@ -1,4 +1,5 @@ --- +title: "Variant Type" linkTitle: "Variant Type" weight: 5 --- diff --git a/content/en/docs/File Format/Types/VariantShredding.md b/content/en/docs/File Format/Types/VariantShredding.md index ce476b0b..ba6069ac 100644 --- a/content/en/docs/File Format/Types/VariantShredding.md +++ b/content/en/docs/File Format/Types/VariantShredding.md @@ -1,4 +1,5 @@ --- +title: "Variant Shredding" linkTitle: "Variant Shredding" weight: 5 --- diff --git a/content/en/docs/File Format/Types/logicaltypes.md b/content/en/docs/File Format/Types/logicaltypes.md index 3153b68d..c57a7be7 100644 --- a/content/en/docs/File Format/Types/logicaltypes.md +++ b/content/en/docs/File Format/Types/logicaltypes.md @@ -1,4 +1,5 @@ --- +title: "Logical Types" linkTitle: "Logical Types" weight: 5 --- diff --git a/content/en/docs/File Format/binaryprotocolextensions.md b/content/en/docs/File Format/binaryprotocolextensions.md index 21da480e..ee5408fd 100644 --- a/content/en/docs/File Format/binaryprotocolextensions.md +++ b/content/en/docs/File Format/binaryprotocolextensions.md @@ -1,4 +1,5 @@ --- +title: "Binary Protocol Extensions" linkTitle: "Binary Protocol Extensions" weight: 1 --- diff --git a/content/en/docs/File Format/bloomfilter.md b/content/en/docs/File Format/bloomfilter.md index 97443c12..28e625d9 100644 --- a/content/en/docs/File Format/bloomfilter.md +++ b/content/en/docs/File Format/bloomfilter.md @@ -1,4 +1,5 @@ --- +title: "Bloom Filter" linkTitle: "Bloom Filter" weight: 7 --- diff --git a/content/en/docs/File Format/pageindex.md b/content/en/docs/File Format/pageindex.md index ecd8a9ad..1161f6b0 100644 --- a/content/en/docs/File Format/pageindex.md +++ b/content/en/docs/File Format/pageindex.md @@ -1,4 +1,5 @@ --- +title: "Page Index" linkTitle: "Page Index" weight: 7 ---