Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name: Build and Deploy Parquet Site

on:
push:
branches: [ production ]
branches: [production]
pull_request:

jobs:
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
@@ -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;
}
3 changes: 3 additions & 0 deletions assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion content/en/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Parquet
<a class="btn btn-lg btn-primary me-3 mb-4" href="/docs/">
Documentation <i class="fas fa-arrow-alt-circle-right ms-2"></i>
</a>
<a class="btn btn-lg btn-secondary me-3 mb-4" href="/blog/">
<a class="btn btn-lg btn-outline-light me-3 mb-4" href="/blog/">
Releases <i class="fa fa-arrow-circle-down ms-2 "></i>
</a>
<p class="lead mt-5">
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
11 changes: 3 additions & 8 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ pre = "<i class='fab fa-github'></i>"
[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"
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
43 changes: 42 additions & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,48 @@
{{/* cSpell:ignore docsearch opengraph outputformat */ -}}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

{{ $darkMode := partialCached "dark-mode-config.html" "dark-mode-global" -}}
{{ if $darkMode.enable -}}
{{/* Browser hints before CSS loads */ -}}
<meta name="color-scheme" content="light dark">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000000">

{{/* Styles to set canvas colors and avoid transitions */ -}}
<style>
{{/* Set system colors as default */ -}}
html { background: Canvas; color: CanvasText; }
{{/* Define reasonable dark defaults */ -}}
@media (prefers-color-scheme: dark) {
html { background: #0b0d12; color: #e6e6e6; }
}
{{/* Avoid transitions until theme CSS is loaded */ -}}
html[data-theme-init] * { transition: none !important; }
</style>

{{/* Set theme attribute before CSS loads to prevent flash */ -}}
<script>
(function() {
const themeKey = 'td-color-theme';
const storedTheme = localStorage.getItem(themeKey);
let theme = storedTheme || (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');

if (theme === 'auto') {
theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}

document.documentElement.setAttribute('data-bs-theme', theme);
})();
</script>
{{ end -}}

{{ range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{ end -}}

{{ $outputFormat := partial "outputformat.html" . -}}
{{ if and hugo.IsProduction (ne $outputFormat "print") -}}
{{ if and hugo.IsProduction (ne $outputFormat "print") (ne .Site.Language.Lang "xx") -}}
<meta name="robots" content="index, follow">
{{ else -}}
<meta name="robots" content="noindex, nofollow">
Expand All @@ -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 */ -}}
<script src="{{ "js/jquery-3.7.1.min.js" | relURL }}"></script>
{{ if .Site.Params.offlineSearch -}}
<script defer src="{{ "js/lunr-2.3.9.min.js" | relURL }}"></script>
Expand All @@ -47,6 +85,9 @@
<link rel="stylesheet" href="{{ "css/prism.css" | relURL }}"/>
{{ 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 */ -}}
Expand Down
Empty file.
Empty file.
66 changes: 0 additions & 66 deletions layouts/partials/navbar.html

This file was deleted.

73 changes: 73 additions & 0 deletions layouts/partials/scripts.html
Original file line number Diff line number Diff line change
@@ -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 -}}
<script src='{{ "js/deflate.js" | relURL }}'></script>
{{ 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 -}}
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous"></script>
{{ else -}}
<script src="{{ $js.RelPermalink }}"></script>
{{ end -}}

{{ if .Site.Params.prism_syntax_highlighting -}}
<script src='{{ "js/prism.js" | relURL }}'></script>
{{ else if ( not .Site.Params.disable_click2copy_chroma ) -}}
{{ $c2cJS := resources.Get "js/click-to-copy.js" -}}
{{ if hugo.IsProduction -}}
{{ $c2cJS = $c2cJS | minify | fingerprint -}}
{{ end -}}
<script defer src="{{ $c2cJS.RelPermalink }}" {{ with $c2cJS.Data.Integrity -}}
integrity="{{ . }}" {{ end -}}
crossorigin="anonymous"></script>
{{ end -}}

{{/* Algolia DocSearch JS block removed — cdn.jsdelivr.net is blocked by
Apache's CSP, and we use Lunr offline search instead. */ -}}

<script src='{{ "js/tabpane-persist.js" | relURL }}'></script>
{{ partial "hooks/body-end.html" . -}}