Skip to content

Commit

Permalink
Merge pull request #1882 from rabbitmq/add-release-branches-highlights
Browse files Browse the repository at this point in the history
Add a "What's New" page for RabbitMQ 3.13
  • Loading branch information
dumbbell committed May 14, 2024
2 parents 3b24586 + 429ae11 commit 6c77952
Show file tree
Hide file tree
Showing 12 changed files with 133 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ const config = {
customFields: {
releaseBranches: {
rabbitmq: {
// RabbitMQ releases per version declared in Docusaurus ('Next' for
// RabbitMQ releases per version declared in Docusaurus ('current' for
// the future docs).
'Next': {
'current': {
releases: [
],
},
Expand Down
23 changes: 19 additions & 4 deletions src/components/RabbitMQServerReleaseInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from 'react';
import { useState } from 'react';

import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import { useVersions } from '@docusaurus/plugin-content-docs/client';

import UnfoldIcon from './unfold-toggle.svg';

/*
Expand Down Expand Up @@ -63,6 +65,7 @@ export function getReleaseNotesURL(release) {

export function RabbitMQServerReleaseInfoTable() {
const releaseBranches = getReleaseBranches();
const docusaurusVersions = useVersions();

const now = Date.now();
const dateOptions = { year: 'numeric', month: 'short', day: 'numeric' };
Expand All @@ -74,6 +77,8 @@ export function RabbitMQServerReleaseInfoTable() {

var rows = [];
for (const branch in releaseBranches) {
const docusaurusVersion = docusaurusVersions.find((v) => v.name == branch);

const releaseBranch = releaseBranches[branch];
const releases = releaseBranch.releases || [];
const isReleased = typeof releaseBranch.end_of_support !== 'undefined';
Expand Down Expand Up @@ -188,6 +193,16 @@ export function RabbitMQServerReleaseInfoTable() {
}

if (isLatestReleaseForBranch) {
var releaseBranchLink;
if (docusaurusVersion && isReleased) {
const url = `${docusaurusVersion.path}/whats-new`;
releaseBranchLink = <a href={url}>{docusaurusVersion.label}</a>;
} else if (docusaurusVersion) {
releaseBranchLink = docusaurusVersion.label;
} else {
releaseBranchLink = branch;
}

rows.push(
<>
<div className={[
Expand All @@ -204,7 +219,7 @@ export function RabbitMQServerReleaseInfoTable() {
"release-branch",
latestReleaseBranchClassName,
isLatestReleaseForBranch ? "" : showClassName
].join(' ')}>{branch}</div>
].join(' ')}>{releaseBranchLink}</div>
</>
);
}
Expand Down Expand Up @@ -253,7 +268,7 @@ export function RabbitMQServerReleaseInfoTable() {
<div className={[
"release-info-header",
"release-version"
].join(' ')}>Patch</div>
].join(' ')}>Patch and associated docs</div>

<div className={[
"release-info-header",
Expand Down Expand Up @@ -284,8 +299,8 @@ export function RabbitMQServerReleaseInfoTable() {
<dd>Old release, still supported but upgrade is recommended</dd>
<dt className="unsupported-release"></dt>
<dd>Old release, unsupported</dd>
{(typeof releaseBranches['Next'].releases !== 'undefined' &&
releaseBranches['Next'].releases.length > 0) ?
{(typeof releaseBranches['current'].releases !== 'undefined' &&
releaseBranches['current'].releases.length > 0) ?
<>
<dt className="unsupported-release future-release"></dt>
<dd>Future version, unsupported</dd>
Expand Down
6 changes: 6 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ html[data-theme='dark'] .mermaid-msg > rect {
font-size: smaller !important;
}

.floating-logo {
max-width: 175px;
max-height: 175px;
float: right;
}

/* -------------------------------------------------------------------
* OneTrust useless cookie icon.
* ------------------------------------------------------------------- */
Expand Down
22 changes: 22 additions & 0 deletions static/img/khepri-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions static/img/mqtt-logo/mqtt-hor-neg.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions static/img/mqtt-logo/mqtt-hor-transp.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions static/img/mqtt-logo/mqtt-hor.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions static/img/mqtt-logo/mqtt-ver-neg.svg
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 6c77952

Please sign in to comment.