Skip to content

Commit

Permalink
Update docs only for actively maintained versions
Browse files Browse the repository at this point in the history
  • Loading branch information
visortelle committed Mar 14, 2024
1 parent 7dd58e6 commit a7b35cf
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 27 deletions.
6 changes: 5 additions & 1 deletion contribute/document-contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ Currently, the source of documents and website (where the docs are finally publi

## Update versioned docs

If you want to update versioned docs, go to [versioned_docs folder](https://github.com/apache/pulsar-site/tree/main/versioned_docs) to find your desired one.
Documentation should be up to date for all [actively supported versions](https://pulsar.apache.org/contribute/release-policy/#supported-versions).

No need to update documentation for versions that are not actively maintained unless the documentation is incorrect.

To update versioned docs, go to [versioned_docs folder](https://github.com/apache/pulsar-site/tree/main/versioned_docs).

For versions prior to 2.8, Pulsar releases versioned docs for each patch release. You can update the exact versioned doc.

Expand Down
17 changes: 16 additions & 1 deletion contribute/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,22 @@ Read more on the manual of [pytools](https://github.com/apache/pulsar-site/tree/

If you're working on a patch release for an older feature version of Pulsar, you can skip this step.

Otherwise, you should update the version in this file: https://github.com/apache/pulsar-site/blob/26671a6ce02ed529eb26072846aedf14e4ab31a5/static/.htaccess#L19
Otherwise, you should update the version in this file: <https://github.com/apache/pulsar-site/blob/26671a6ce02ed529eb26072846aedf14e4ab31a5/static/.htaccess#L19>

## Update `/docs` version list dropdown

The dropdown should have the following items:
- Next
- Active versions [still in support](/contribute/release-policy/#supported-versions)
- Others

LTS versions should be labeled this way: `<version> LTS`.

<img alt="docs version dropdown" src="/img/version-dropdown.png" width="320px" />

If you're working on a patch release for an older feature version of Pulsar, you can skip this step.

Otherwise, you should update the dropdown version list in this file: <https://github.com/apache/pulsar-site/blob/main/src/theme/DocsVersionDropdownNavbarItem.js>

## Announce the release

Expand Down
51 changes: 26 additions & 25 deletions src/theme/DocsVersionDropdownNavbarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,28 @@
import React from "react";
import DefaultNavbarItem from "@theme/NavbarItem/DefaultNavbarItem";
import DropdownNavbarItem from "@theme/NavbarItem/DropdownNavbarItem";
import {useActiveDocContext, useLatestVersion,} from "@docusaurus/plugin-content-docs/client";
import {useDocsPreferredVersion} from "@docusaurus/theme-common";
import {translate} from "@docusaurus/Translate";
import { useActiveDocContext, useLatestVersion, } from "@docusaurus/plugin-content-docs/client";
import { useDocsPreferredVersion } from "@docusaurus/theme-common";
import { translate } from "@docusaurus/Translate";

let versions = require("../../versions.json");
versions = [{ name: "current", label: "Next", path: "/docs/next" }]
.concat(
versions.map((item) => {
return {
label: item,
name: item,
path: "/docs/" + item,
};
})
)
.slice(0, 5)
.concat({
name: "others",
label: "Others",
path: "/versions",
});
const versions = [{ name: "current", label: "Next", path: "/docs/next" }]
.concat([
{
label: '3.2.x',
name: '3.2.x',
path: `/docs/3.2.x`,
},
{
label: '3.0.x LTS',
name: '3.0.x',
path: `/docs/3.0.x`,
},
{
name: "others",
label: "Others",
path: "/versions",
}
]);

const getVersionMainDoc = (version) =>
version.docs.find((doc) => doc.id === version.mainDocId);
Expand Down Expand Up @@ -74,11 +75,11 @@ export default function DocsVersionDropdownNavbarItem({
const dropdownLabel =
mobile && items.length > 1
? translate({
id: "theme.navbar.mobileVersionsDropdown.label",
message: "Versions",
description:
"The label for the navbar versions dropdown on mobile view",
})
id: "theme.navbar.mobileVersionsDropdown.label",
message: "Versions",
description:
"The label for the navbar versions dropdown on mobile view",
})
: dropdownVersion.label;
const dropdownTo =
mobile && items.length > 1
Expand Down
Binary file added static/img/version-dropdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a7b35cf

Please sign in to comment.