Skip to content

Commit bd4e234

Browse files
authored
Merge pull request #20229 from cockroachdb/feat/archival-page
Add archived documentation page with v19.2 support
2 parents b4bcb35 + 84fd7f7 commit bd4e234

File tree

4 files changed

+73
-16
lines changed

4 files changed

+73
-16
lines changed

src/current/_includes/corestyle.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,16 @@ div#feature-highlights .feature-description {
10641064
}
10651065
}
10661066

1067+
1068+
.sidebar__tag--new {
1069+
background: #6933ff;
1070+
color: #fff;
1071+
font-size: 10px;
1072+
padding: 2px 6px;
1073+
border-radius: 4px;
1074+
margin-left: 8px;
1075+
}
1076+
10671077
.roles-table {
10681078
table {
10691079
width: 100%; // Let the table stretch to the full container width
@@ -1104,3 +1114,4 @@ div#feature-highlights .feature-description {
11041114
width: 1%; // Hint browser to minimize these columns if possible
11051115
}
11061116
}
1117+

src/current/_includes/sidebar-all-releases.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,11 @@
7373
"urls": [
7474
"/releases/unsupported-versions.html"
7575
]
76+
},
77+
{
78+
"title": "Archived Documentation",
79+
"urls": [
80+
81+
"/releases/archived-documentation.html"
82+
]
7683
}

src/current/_includes/sidebar.js.html

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
// source for the underlying version, like v1.0 or v1.1.
5656
// Otherwise, the sidebar for a `stable` page would
5757
// inappropriately link to the underlying `v1.0` page instead
58-
// of the `stable` alias.
5958
const pageVersion = (function () {
6059
const pathComponents = location.pathname
6160
.replace(sidebar.baseUrl, '')
@@ -89,7 +88,7 @@
8988
// entry, if any, into the `.collapsed-header` element above.
9089
function renderItems(items, paths) {
9190
if (!items || items.length == 0)
92-
return $();
91+
return $();
9392

9493
const lis = items.map(function (item) {
9594
const urls = (item.urls || []).map(function (url) {
@@ -103,20 +102,13 @@
103102
});
104103

105104
// this ensures page will be highlighted in sidebar if URL is accessed with or without `.html` appended
106-
var activePathname
107-
if (!/^https?:/.test(location.pathname)) {
108-
activePathname = location.pathname
105+
var activePathname = location.pathname;
106+
if (activePathname.includes("/index.html")) {
107+
activePathname = activePathname.replace("/index.html", "/");
109108
}
110-
else {
111-
activePathname = location.pathname
109+
if (activePathname.includes(".html")) {
110+
activePathname = activePathname.replace(".html", "");
112111
}
113-
if (location.pathname.includes("/index.html")) {
114-
activePathname = activePathname.replace("/index.html", "/")
115-
}
116-
if (location.pathname.includes(".html")) {
117-
activePathname = activePathname.replace(".html", "")
118-
}
119-
// console.log(urls);
120112

121113
const active = (urls.indexOf(activePathname) !== -1);
122114
if (active) {
@@ -136,8 +128,19 @@
136128
.attr("href", urls[0] || "#")
137129
.html(item.title);
138130

131+
// ── **INJECT TAG BADGE HERE** ─────────────────────────
132+
if (item.tag) {
133+
a.append(" ")
134+
.append(
135+
$("<span>")
136+
.addClass("sidebar__tag sidebar__tag--new")
137+
.text(item.tag)
138+
);
139+
}
140+
// ──────────────────────────────────────────────────────
141+
139142
if (subitems.length > 0 && !item.is_top_level) {
140-
a.append(" ").append($("<div>").addClass("nav-expand"));
143+
a.append(" ").append($("<div>").addClass("nav-expand"));
141144
}
142145

143146
return $("<li>")
@@ -165,7 +168,7 @@
165168
// Version directories either are one of the named version
166169
// aliases specified in _config.yml or have the form "vX.X",
167170
// like "v1.0" or "v1.10".
168-
return {{ site.versions | jsonify }}[d] || /^v\d+.\d+$/.test(d);
171+
return {{ site.versions | jsonify }}[d] || /^v\d+\.\d+$/.test(d);
169172
},
170173
items: {%- include_cached {{ include.sidebar_data }} -%}
171174
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Archived Documentation
3+
summary: Documentation for CockroachDB versions that are no longer supported
4+
5+
toc: false # hide “On this page” nav
6+
docs_area: releases
7+
---
8+
9+
10+
This page contains downloads of archived documentation for CockroachDB versions that are no longer supported.
11+
12+
{{ site.data.alerts.callout_info }}
13+
Cockroach Labs recommends using a [supported version]({% link releases/release-support-policy.md %}) of CockroachDB for which documentation is actively maintained. The archived documentation on this page is provided **as-is** and is no longer maintained.
14+
{{ site.data.alerts.end }}
15+
16+
## Archived versions
17+
18+
The table below contains links to archived documentation for versions of CockroachDB that are [no longer supported]({% link releases/release-support-policy.md %}#unsupported-versions).
19+
20+
21+
<div class="wide-overflow" markdown="1">
22+
23+
<table>
24+
<thead>
25+
<tr><th>Version</th><th>Downloads</th></tr>
26+
</thead>
27+
<tbody>
28+
<tr><td><strong>v19.2</strong></td>
29+
<td><a href="https://storage.googleapis.com/crdbdocs-archive/archive_19.2.zip" class="download-link">ZIP</a></td></tr>
30+
</tbody>
31+
</table>
32+
33+
</div>
34+
35+
## Looking for current documentation?
36+
Visit our [current documentation](/docs/stable/) for the latest CockroachDB versions.

0 commit comments

Comments
 (0)