Skip to content

Commit 958e209

Browse files
authored
[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
1 parent e9087e3 commit 958e209

File tree

3 files changed

+82
-6
lines changed

3 files changed

+82
-6
lines changed

site/amoro-docs/hugo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ home = [ "HTML", "RSS", "SearchIndex" ]
3636
{ name = "Benchmark Report", parent = "Benchmark", pre = "relative", url = "../../benchmark-report/", weight = 301 },
3737
{ name = "Benchmark Guide", parent = "Benchmark", pre = "relative", url = "../../benchmark-guide/", weight = 302 },
3838
{ name = "Download", pre = "relative", url = "../../download/", weight = 400 },
39-
{ name = "blogs", pre = "relative", url = "../../blogs/", weight = 500 },
39+
{ name = "Blogs", pre = "relative", url = "../../blogs/", weight = 500 },
4040
{ name = "Community", weight = 600 },
4141
{ name = "Join Community", parent = "Community", pre = "relative", url = "../../join-community/", weight = 601 },
4242
{ name = "How to contribute", parent = "Community", pre = "relative", url = "../../how-to-contribute/", weight = 602 },

site/amoro-theme/layouts/partials/body.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@
1414
</script>
1515
</head>
1616
{{ partial "header.html" . }}
17+
{{ $isLatestDocs := and (eq .Site.Params.siteType "docs") (or (in .Site.BaseURL "/docs/latest") (in .Site.Home.Permalink "/docs/latest")) }}
18+
{{ $stableVersionName := "" }}
19+
{{ $stableVersionURL := "" }}
20+
{{ range .Site.Menus.topnav }}
21+
{{ if eq .Name "Docs" }}
22+
{{ range .Children }}
23+
{{ if and (ne .Name "latest") (eq $stableVersionName "") }}
24+
{{ $stableVersionName = .Name }}
25+
{{ $stableVersionURL = .URL }}
26+
{{ end }}
27+
{{ end }}
28+
{{ end }}
29+
{{ end }}
1730
<body dir="{{ .Site.Language.LanguageDirection | default " ltr" }}">
1831
<section>
1932
<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 @@
2235
{{ end }}
2336
<div id="content" class="markdown-body">
2437
<div class="{{ if not .Params.disableToc }}margin-for-toc{{ else }}margin-without-toc{{ end }}">
38+
{{ if $isLatestDocs }}
39+
<div class="latest-docs-note">
40+
<p>This documentation reflects the <code>latest</code> development version and may change before the next official release.</p>
41+
<p>
42+
For the latest stable documentation, see
43+
<a href="{{ $.Site.BaseURL }}{{ $stableVersionURL }}"><strong>{{ $stableVersionName }}</strong></a>.
44+
</p>
45+
</div>
46+
{{ end }}
2547
{{- .Content -}}
2648
</div>
2749
{{ if not .Params.disableToc }}

site/amoro-theme/static/css/amoro-theme.css

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ i {
362362
}
363363
.margin-for-toc {
364364
margin-right: 0;
365+
padding-right: 20px;
365366
}
366367
section {
367368
margin-left: 20px;
@@ -400,6 +401,59 @@ i {
400401
background-color: #FFD2D2;
401402
}
402403

404+
.latest-docs-note {
405+
margin: 8px 0 20px;
406+
padding: 18px 22px;
407+
border-left: 8px solid #f2a900;
408+
border-radius: 14px;
409+
background: #fff6df;
410+
color: #5b4108;
411+
box-shadow: 0 2px 10px rgba(62, 42, 0, 0.08);
412+
}
413+
414+
.latest-docs-note p {
415+
margin: 0;
416+
font-size: inherit;
417+
line-height: inherit;
418+
}
419+
420+
.latest-docs-note p + p {
421+
margin-top: 12px;
422+
}
423+
424+
.latest-docs-note strong {
425+
font-weight: 700;
426+
}
427+
428+
.latest-docs-note a {
429+
color: #5b4108;
430+
text-decoration: underline;
431+
text-decoration-thickness: 2px;
432+
text-underline-offset: 4px;
433+
}
434+
435+
.latest-docs-note a:hover {
436+
color: #3f2d05;
437+
}
438+
439+
@media screen and (max-width: 768px) {
440+
.latest-docs-note {
441+
margin: 8px 0 18px;
442+
padding: 16px 18px;
443+
border-left-width: 6px;
444+
border-radius: 12px;
445+
}
446+
447+
.latest-docs-note p {
448+
font-size: inherit;
449+
line-height: inherit;
450+
}
451+
452+
.latest-docs-note p + p {
453+
margin-top: 10px;
454+
}
455+
}
456+
403457
.fa-table {
404458
color: #000000;
405459
}
@@ -804,8 +858,8 @@ a.top-menu {
804858
}
805859
}
806860

807-
@media screen and (max-width: 400px) {
808-
.codetabs label {
809-
padding: 15px;
810-
}
811-
}
861+
@media screen and (max-width: 400px) {
862+
.codetabs label {
863+
padding: 15px;
864+
}
865+
}

0 commit comments

Comments
 (0)