Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs only for actively maintained versions #843

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
49 changes: 27 additions & 22 deletions src/theme/DocsVersionDropdownNavbarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,32 @@
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({
const versions = [
{
name: "current",
label: "Next",
path: "/docs/next"
},
{
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 +79,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.
Loading