This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/airflow-site.git

commit e6dc0de7b8d23efda5458f017b418b56491f66d5
Author: Kaxil Naik <[email protected]>
AuthorDate: Sun Nov 9 04:10:11 2025 +0000

    Fix CSS generation for Docsy v0.12.0 upgrade
    
    Custom CSS (main-custom.scss) was not being generated after upgrading
    Docsy from v0.2.0-pre to v0.12.0.
    
    Root cause:
    Docsy v0.12.0 has layouts/_partials/head.html which Hugo prioritizes
    over our layouts/partials/head.html, so our CSS processing wasn't called.
    
    Fix:
    - Add layouts/_partials/head.html to override Docsy's template
    - Add layouts/_partials/head-css.html (must exist in same directory)
    - Remove CSS processing from head-end.html hook (moved to head-css.html)
---
 landing-pages/site/layouts/_partials/head-css.html | 41 +++++++++++++++++++++
 landing-pages/site/layouts/_partials/head.html     | 42 ++++++++++++++++++++++
 .../site/layouts/partials/hooks/head-end.html      | 10 ------
 3 files changed, 83 insertions(+), 10 deletions(-)

diff --git a/landing-pages/site/layouts/_partials/head-css.html 
b/landing-pages/site/layouts/_partials/head-css.html
new file mode 100644
index 0000000000..499c6e962b
--- /dev/null
+++ b/landing-pages/site/layouts/_partials/head-css.html
@@ -0,0 +1,41 @@
+{{/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/}}
+{{/* Process Docsy's main stylesheet */}}
+{{ $scssMain := "scss/main.scss"}}
+{{ if hugo.IsServer }}
+{{/* Note the missing postCSS. This makes it snappier to develop in Chrome, 
but makes it look suboptimal in other browsers. */}}
+{{ $css := resources.Get $scssMain | toCSS (dict "enableSourceMap" true) }}
+<link href="{{ $css.RelPermalink }}" rel="stylesheet">
+{{ else }}
+{{ $css := resources.Get $scssMain | toCSS (dict "enableSourceMap" false) | 
postCSS | minify | fingerprint }}
+<link rel="preload" href="{{ $css.RelPermalink }}" as="style">
+<link href="{{ $css.RelPermalink }}" rel="stylesheet" integrity="{{ 
$css.Data.integrity }}">
+{{ end }}
+
+{{/* Process our custom stylesheet for landing pages */}}
+{{ $scssCustom := "scss/main-custom.scss"}}
+{{ $customScssResource := resources.Get $scssCustom }}
+{{ if hugo.IsServer }}
+{{ $cssCustom := $customScssResource | toCSS (dict "enableSourceMap" true) | 
postCSS }}
+<link href="{{ $cssCustom.RelPermalink }}" rel="stylesheet">
+{{ else }}
+{{ $cssCustom := $customScssResource | toCSS (dict "enableSourceMap" false) | 
postCSS | minify | fingerprint }}
+<link rel="preload" href="{{ $cssCustom.RelPermalink }}" as="style">
+<link href="{{ $cssCustom.RelPermalink }}" rel="stylesheet" integrity="{{ 
$cssCustom.Data.integrity }}">
+{{ end }}
diff --git a/landing-pages/site/layouts/_partials/head.html 
b/landing-pages/site/layouts/_partials/head.html
new file mode 100644
index 0000000000..9fc5a3b070
--- /dev/null
+++ b/landing-pages/site/layouts/_partials/head.html
@@ -0,0 +1,42 @@
+{{/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/}}
+<meta charset="{{ .Site.Params.charset }}">
+<meta name="viewport" content="width=device-width, initial-scale=1, 
shrink-to-fit=no">
+{{ hugo.Generator }}
+{{ if eq (getenv "HUGO_ENV") "production" }}
+<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
+{{ else }}
+<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
+{{ end }}
+{{ range .AlternativeOutputFormats -}}
+<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | 
safeURL }}">
+{{ end -}}
+{{ partialCached "favicons.html" . }}
+<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | 
{{ end }}{{ .Site.Title }}{{ end }}</title>
+{{- template "_internal/opengraph.html" . -}}
+{{- template "_internal/schema.html" . -}}
+{{ if eq (getenv "HUGO_ENV") "production" }}
+{{ template "_internal/google_analytics.html" . }}
+{{ end }}
+{{ partial "head-css.html" . }}
+<script
+  src="/external/js/jquery-3.3.1.min.js"
+  integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
+  crossorigin="anonymous"></script>
+{{ partial "hooks/head-end.html" . }}
diff --git a/landing-pages/site/layouts/partials/hooks/head-end.html 
b/landing-pages/site/layouts/partials/hooks/head-end.html
index 16d8edb652..dec8657f52 100644
--- a/landing-pages/site/layouts/partials/hooks/head-end.html
+++ b/landing-pages/site/layouts/partials/hooks/head-end.html
@@ -19,16 +19,6 @@
 
 <meta name="description" content="{{ .Description | default 
$.Site.Params.description }}" />
 
-{{ $scssMain := "scss/main-custom.scss"}}
-{{ if hugo.IsServer }}
-    {{ $css := resources.Get $scssMain | toCSS (dict "enableSourceMap" true) | 
postCSS }}
-    <link href="{{ $css.RelPermalink }}" rel="stylesheet">
-{{ else }}
-    {{ $css := resources.Get $scssMain | toCSS (dict "enableSourceMap" false) 
| postCSS | minify | fingerprint }}
-    <link rel="preload" href="{{ $css.RelPermalink }}" as="style">
-    <link href="{{ $css.RelPermalink }}" rel="stylesheet" integrity="{{ 
$css.Data.integrity }}">
-{{ end }}
-
 <!-- Matomo -->
 <script>
     var _paq = window._paq = window._paq || [];

Reply via email to