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 version banner #1431

Merged
merged 3 commits into from
Dec 6, 2023
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
12 changes: 8 additions & 4 deletions src/components/shared/version-banner/version-banner.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Link } from 'gatsby';
import React from 'react';
import { LATEST_VERSION } from 'utils/versioning';

Expand All @@ -9,14 +8,19 @@ export const VersionBanner = ({ version, versions }) => (
<div className={'container'}>
<div className={styles.inner}>
<span className={styles.message}>
⚠️ This is archived documentation for <b>{version}</b>.
⚠️ This is the archived documentation for k6 <b>{version}</b>.
{typeof versions[LATEST_VERSION] !== 'undefined' && (
<span>
{' '}
Go to the{' '}
<Link className={'link'} to={versions[LATEST_VERSION].path}>
<a
href="https://grafana.com/docs/k6/latest/"
target="_blank"
rel="noreferrer"
>
latest version
</Link>
</a>
.
</span>
)}
</span>
Expand Down
5 changes: 1 addition & 4 deletions src/layouts/doc-layout/doc-layout.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
import { childrenToList, isInIFrame } from 'utils';
import AlgoliaQueries from 'utils/algolia';
import { main, app } from 'utils/urls';
import { LATEST_VERSION } from 'utils/versioning';

import styles from './doc-layout.module.scss';
import ArrowLeft from './svg/arrow-left.inline.svg';
Expand Down Expand Up @@ -420,9 +419,7 @@ export const DocLayout = ({
</div>
</div>
</Header>
{version && version !== LATEST_VERSION && (
<VersionBanner version={version} versions={pageVersions} />
)}
{version && <VersionBanner version={version} versions={pageVersions} />}

{children}
<MobileNav
Expand Down
2 changes: 1 addition & 1 deletion src/templates/docs/javascript-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const JavascriptAPI = ({
description={
'The list of k6 modules natively supported in your k6 scripts.'
}
className={classNames(version !== LATEST_VERSION && jsApiStyles.info)}
className={classNames(jsApiStyles.info)}
/>
<div className={docPageContent.inner}>
<div ref={contentContainerRef} className={stickyContainerClasses}>
Expand Down
Loading