diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3d026b98..bcf7ba0a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,7 +21,7 @@ name: Build and Deploy Parquet Site on: push: - branches: [ production ] + branches: [production] pull_request: jobs: @@ -38,17 +38,17 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: '0.152.0' + hugo-version: "0.155.3" extended: true - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: "1.22" - uses: actions/setup-node@v4 with: - node-version: '20' + node-version: "20" - name: Cache dependencies uses: actions/cache@v4 diff --git a/assets/scss/_styles_project.scss b/assets/scss/_styles_project.scss new file mode 100644 index 00000000..bb23a3e6 --- /dev/null +++ b/assets/scss/_styles_project.scss @@ -0,0 +1,5 @@ +// Make navbar transparent on cover pages so it blends with the hero image +.td-navbar.td-navbar-cover.td-navbar-transparent { + --td-navbar-bg-color: transparent; + --bs-bg-opacity: 0; +} diff --git a/assets/scss/_variables_project.scss b/assets/scss/_variables_project.scss index 94a8dd37..65f46bc3 100644 --- a/assets/scss/_variables_project.scss +++ b/assets/scss/_variables_project.scss @@ -6,5 +6,8 @@ Add styles or override variables from the theme here. $primary: #56a4ed; +// Set navbar background to primary blue (Docsy v0.14+ defaults to white) +$td-navbar-bg-color: $primary; + // Disable Google Fonts to comply with apache.org Content Security Policy $td-enable-google-fonts: false; diff --git a/content/en/_index.md b/content/en/_index.md index cf71dd0c..32437f94 100644 --- a/content/en/_index.md +++ b/content/en/_index.md @@ -6,7 +6,7 @@ title: Parquet Documentation - + Releases

diff --git a/go.mod b/go.mod index 6c4ad7cd..f35d9133 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,6 @@ go 1.12 require ( github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3 // indirect - github.com/google/docsy v0.12.0 // indirect + github.com/google/docsy v0.14.2 // indirect github.com/twbs/bootstrap v5.3.8+incompatible // indirect ) diff --git a/go.sum b/go.sum index 6a51e65b..4e1a58c2 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3 h1:/iluJk github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= github.com/google/docsy v0.12.0 h1:CddZKL39YyJzawr8GTVaakvcUTCJRAAYdz7W0qfZ2P4= github.com/google/docsy v0.12.0/go.mod h1:1bioDqA493neyFesaTvQ9reV0V2vYy+xUAnlnz7+miM= +github.com/google/docsy v0.14.2 h1:XJud05ZWCUFgvE9G1KdxhGsDdr7OmWYdnWPxrclIPWE= +github.com/google/docsy v0.14.2/go.mod h1:1Fj1W1O3esZh7IBQ8XAYtxtg10udBXuGI89+LUQc1AU= github.com/twbs/bootstrap v5.3.6+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= github.com/twbs/bootstrap v5.3.8+incompatible h1:eK1fsXP7R/FWFt+sSNmmvUH9usPocf240nWVw7Dh02o= github.com/twbs/bootstrap v5.3.8+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= diff --git a/hugo.toml b/hugo.toml index 347fb930..ce4fcfdb 100644 --- a/hugo.toml +++ b/hugo.toml @@ -27,13 +27,6 @@ pre = "" [permalinks] blog = "/:section/:year/:month/:day/:slug/" -## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday -[blackfriday] -plainIDAnchors = true -hrefTargetBlank = true -angledQuotes = false -latexDashes = true - # Image processing configuration. [imaging] resampleFilter = "CatmullRom" @@ -117,6 +110,8 @@ breadcrumb_disable = false footer_about_enable = true # Set to false if you don't want to display a logo (/assets/icons/logo.svg) in the top navbar navbar_logo = true +# Use dark theme for navbar (white text on blue background) +navbar_theme = "dark" # Set to true if you don't want the top navbar to be translucent when over a `block/cover`, like on the homepage. navbar_translucent_over_cover_disable = false # Enable to show the side bar menu in its compact state. @@ -170,7 +165,7 @@ desc = "Parquet specification" # workspace = "docsy.work" [module.hugoVersion] extended = true -min = "0.152.0" +min = "0.155.3" [[module.imports]] path = "github.com/google/docsy" disable = false diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ca7039d9..08cea484 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -13,12 +13,48 @@ {{/* cSpell:ignore docsearch opengraph outputformat */ -}} + +{{ $darkMode := partialCached "dark-mode-config.html" "dark-mode-global" -}} +{{ if $darkMode.enable -}} +{{/* Browser hints before CSS loads */ -}} + + + + +{{/* Styles to set canvas colors and avoid transitions */ -}} + + +{{/* Set theme attribute before CSS loads to prevent flash */ -}} + +{{ end -}} + {{ range .AlternativeOutputFormats -}} {{ end -}} {{ $outputFormat := partial "outputformat.html" . -}} -{{ if and hugo.IsProduction (ne $outputFormat "print") -}} +{{ if and hugo.IsProduction (ne $outputFormat "print") (ne .Site.Language.Lang "xx") -}} {{ else -}} @@ -38,6 +74,8 @@ {{ partial "schema.html" . -}} {{ partial "twitter_cards.html" . -}} {{ partialCached "head-css.html" . "head-css-cache-key" -}} + +{{/* CSP fix: load jQuery and Lunr from local vendored copies instead of CDN */ -}} {{ if .Site.Params.offlineSearch -}} @@ -47,6 +85,9 @@ {{ end -}} +{{/* Algolia DocSearch CSS block removed — cdn.jsdelivr.net is blocked by + Apache's CSP, and we use Lunr offline search instead. */ -}} + {{ partial "hooks/head-end.html" . -}} {{/* To comply with GDPR, cookie consent scripts places in head-end must execute before Google Analytics is enabled */ -}} diff --git a/layouts/partials/hooks/body-end.html b/layouts/partials/hooks/body-end.html deleted file mode 100644 index e69de29b..00000000 diff --git a/layouts/partials/hooks/head-end.html b/layouts/partials/hooks/head-end.html deleted file mode 100644 index e69de29b..00000000 diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html deleted file mode 100644 index c0b643a1..00000000 --- a/layouts/partials/navbar.html +++ /dev/null @@ -1,66 +0,0 @@ -{{ $cover := and - (.HasShortcode "blocks/cover") - (not .Site.Params.ui.navbar_translucent_over_cover_disable) --}} -{{ $baseURL := urls.Parse $.Site.Params.Baseurl -}} - -

\ No newline at end of file diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html new file mode 100644 index 00000000..922a0cf5 --- /dev/null +++ b/layouts/partials/scripts.html @@ -0,0 +1,73 @@ +{{/* + Project-level override of Docsy v0.14.2's layouts/_partials/scripts.html + + Why this file exists: + Removes the Algolia DocSearch JS block (cdn.jsdelivr.net) and the + markmap-autoloader CDN reference, both blocked by Apache's CSP. + + See: https://github.com/apache/parquet-site/issues/163 +*/ -}} +{{/* cSpell:ignore docsearch markmap plantuml katex hasmermaid */ -}} + +{{/* 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 -}} + +{{ $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 .Page.Store.Get "hasMath" -}} + {{ partial "scripts/katex.html" . -}} +{{ end -}} + +{{- $darkMode := partialCached "dark-mode-config.html" "dark-mode-global" -}} +{{ if $darkMode.enable -}} + {{ $jsArray = $jsArray | append (resources.Get "js/dark-mode.js") -}} +{{ end -}} + +{{ if not (.Param "ui.scrollSpy.disable") -}} + {{ $jsScrollSpyPatch := resources.Get "js/scrollspy-patch.js" -}} + {{ $jsArray = $jsArray | append $jsScrollSpyPatch -}} +{{ 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 -}} + +{{/* Algolia DocSearch JS block removed — cdn.jsdelivr.net is blocked by + Apache's CSP, and we use Lunr offline search instead. */ -}} + + +{{ partial "hooks/body-end.html" . -}}