This is an automated email from the ASF dual-hosted git repository.
xuba pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git
The following commit(s) were added to refs/heads/master by this push:
new 958e2093d [site] Fix docs latest notice and Blogs label (#4144)
958e2093d is described below
commit 958e2093d973482420012513ade460675e10da2b
Author: Xu Bai <[email protected]>
AuthorDate: Tue Mar 31 14:28:10 2026 +0800
[site] Fix docs latest notice and Blogs label (#4144)
* Fix docs latest notice and blogs label
* Fix stable docs link path in latest notice
* fix css
---
site/amoro-docs/hugo.toml | 2 +-
site/amoro-theme/layouts/partials/body.html | 22 ++++++++++
site/amoro-theme/static/css/amoro-theme.css | 64 ++++++++++++++++++++++++++---
3 files changed, 82 insertions(+), 6 deletions(-)
diff --git a/site/amoro-docs/hugo.toml b/site/amoro-docs/hugo.toml
index 143f28afe..98d3a2f5d 100644
--- a/site/amoro-docs/hugo.toml
+++ b/site/amoro-docs/hugo.toml
@@ -36,7 +36,7 @@ home = [ "HTML", "RSS", "SearchIndex" ]
{ name = "Benchmark Report", parent = "Benchmark", pre = "relative", url =
"../../benchmark-report/", weight = 301 },
{ name = "Benchmark Guide", parent = "Benchmark", pre = "relative", url =
"../../benchmark-guide/", weight = 302 },
{ name = "Download", pre = "relative", url = "../../download/", weight =
400 },
- { name = "blogs", pre = "relative", url = "../../blogs/", weight = 500 },
+ { name = "Blogs", pre = "relative", url = "../../blogs/", weight = 500 },
{ name = "Community", weight = 600 },
{ name = "Join Community", parent = "Community", pre = "relative", url =
"../../join-community/", weight = 601 },
{ name = "How to contribute", parent = "Community", pre = "relative", url
= "../../how-to-contribute/", weight = 602 },
diff --git a/site/amoro-theme/layouts/partials/body.html
b/site/amoro-theme/layouts/partials/body.html
index fe4cc01d8..f040d46b4 100644
--- a/site/amoro-theme/layouts/partials/body.html
+++ b/site/amoro-theme/layouts/partials/body.html
@@ -14,6 +14,19 @@
</script>
</head>
{{ partial "header.html" . }}
+{{ $isLatestDocs := and (eq .Site.Params.siteType "docs") (or (in
.Site.BaseURL "/docs/latest") (in .Site.Home.Permalink "/docs/latest")) }}
+{{ $stableVersionName := "" }}
+{{ $stableVersionURL := "" }}
+{{ range .Site.Menus.topnav }}
+ {{ if eq .Name "Docs" }}
+ {{ range .Children }}
+ {{ if and (ne .Name "latest") (eq $stableVersionName "") }}
+ {{ $stableVersionName = .Name }}
+ {{ $stableVersionURL = .URL }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
+{{ end }}
<body dir="{{ .Site.Language.LanguageDirection | default " ltr" }}">
<section>
<div class="grid-container {{ if and (not .Params.disableSidebar) (not
.Params.disableToc) }}leftnav-and-toc{{ else if not .Params.disableSidebar
}}left-nav-only{{ else if not .Params.disableToc }}toc-only{{ else
}}content-only{{ end }}">
@@ -22,6 +35,15 @@
{{ end }}
<div id="content" class="markdown-body">
<div class="{{ if not .Params.disableToc }}margin-for-toc{{
else }}margin-without-toc{{ end }}">
+ {{ if $isLatestDocs }}
+ <div class="latest-docs-note">
+ <p>This documentation reflects the <code>latest</code>
development version and may change before the next official release.</p>
+ <p>
+ For the latest stable documentation, see
+ <a href="{{ $.Site.BaseURL }}{{ $stableVersionURL
}}"><strong>{{ $stableVersionName }}</strong></a>.
+ </p>
+ </div>
+ {{ end }}
{{- .Content -}}
</div>
{{ if not .Params.disableToc }}
diff --git a/site/amoro-theme/static/css/amoro-theme.css
b/site/amoro-theme/static/css/amoro-theme.css
index c31c55f2f..97fd08209 100644
--- a/site/amoro-theme/static/css/amoro-theme.css
+++ b/site/amoro-theme/static/css/amoro-theme.css
@@ -362,6 +362,7 @@ i {
}
.margin-for-toc {
margin-right: 0;
+ padding-right: 20px;
}
section {
margin-left: 20px;
@@ -400,6 +401,59 @@ i {
background-color: #FFD2D2;
}
+.latest-docs-note {
+ margin: 8px 0 20px;
+ padding: 18px 22px;
+ border-left: 8px solid #f2a900;
+ border-radius: 14px;
+ background: #fff6df;
+ color: #5b4108;
+ box-shadow: 0 2px 10px rgba(62, 42, 0, 0.08);
+}
+
+.latest-docs-note p {
+ margin: 0;
+ font-size: inherit;
+ line-height: inherit;
+}
+
+.latest-docs-note p + p {
+ margin-top: 12px;
+}
+
+.latest-docs-note strong {
+ font-weight: 700;
+}
+
+.latest-docs-note a {
+ color: #5b4108;
+ text-decoration: underline;
+ text-decoration-thickness: 2px;
+ text-underline-offset: 4px;
+}
+
+.latest-docs-note a:hover {
+ color: #3f2d05;
+}
+
+@media screen and (max-width: 768px) {
+ .latest-docs-note {
+ margin: 8px 0 18px;
+ padding: 16px 18px;
+ border-left-width: 6px;
+ border-radius: 12px;
+ }
+
+ .latest-docs-note p {
+ font-size: inherit;
+ line-height: inherit;
+ }
+
+ .latest-docs-note p + p {
+ margin-top: 10px;
+ }
+}
+
.fa-table {
color: #000000;
}
@@ -804,8 +858,8 @@ a.top-menu {
}
}
-@media screen and (max-width: 400px) {
- .codetabs label {
- padding: 15px;
- }
-}
\ No newline at end of file
+@media screen and (max-width: 400px) {
+ .codetabs label {
+ padding: 15px;
+ }
+}