Skip to content

Commit cacd6d4

Browse files
authored
feat: Consolidate all 179 commits from staging (#177)
1 parent 91ad8f2 commit cacd6d4

File tree

64 files changed

+400
-170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+400
-170
lines changed

src/app/_styles/global.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,14 @@
1717
color: var(--color-text-link);
1818
text-decoration: none;
1919
}
20+
21+
.main-header {
22+
position: sticky; /* Or 'fixed' */
23+
top: 0;
24+
width: 100%;
25+
z-index: 50;
26+
27+
/* Add this line 👇 */
28+
padding-top: var(--banner-height, 0px);
29+
}
2030
}

src/app/layout.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import LegacySiteBanner from '../components/LegacySiteBanner';
12
import { Navbar } from '@/components';
23
import { cx } from 'class-variance-authority';
34
import type { Metadata } from 'next';
5+
import Script from "next/script";
46
import { Suspense } from 'react';
57
import { mdSystem, replica, replicaMono } from './_assets/fonts';
68
import { NavigationEvents, NavigationProvider } from './navigation';
@@ -22,14 +24,31 @@ export default function RootLayout({ children }: { children: React.ReactNode })
2224
return (
2325
<html lang="en" className={cx(mdSystem.variable, replica.variable, replicaMono.variable)}>
2426
<body>
27+
<LegacySiteBanner />
2528
<NavigationProvider>
2629
<Navbar />
2730
{children}
31+
<noscript>
32+
<img
33+
src="https://simple.cloudsmith.com/noscript.gif?collect-dnt=true&hostname=docs.cloudsmith.com"
34+
alt=""
35+
referrerPolicy="no-referrer-when-downgrade"
36+
/>
37+
</noscript>
2838
<Suspense fallback={null}>
2939
<NavigationEvents />
3040
</Suspense>
3141
</NavigationProvider>
3242
</body>
43+
<Script
44+
strategy="afterInteractive"
45+
async
46+
defer
47+
src="https://simple.cloudsmith.com/latest.js"
48+
data-collect-dnt="true"
49+
data-hostname="docs.cloudsmith.com"
50+
/>
3351
</html>
3452
);
3553
}
54+

src/components/LegacySiteBanner.js

Whitespace-only changes.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
.bannerContainer {
3+
background-color: #B7D2FF;
4+
color: #041e2e;
5+
display: flex;
6+
align-items: center;
7+
justify-content: space-between;
8+
padding: 12px 16px;
9+
width: 100%;
10+
box-sizing: border-box;
11+
font-family: sans-serif;
12+
font-size: 14px;
13+
font-weight: 500;
14+
line-height: 1.5;
15+
position: relative;
16+
z-index: 1000;
17+
}
18+
19+
.bannerContent {
20+
display: flex;
21+
align-items: center;
22+
gap: 12px;
23+
flex-wrap: wrap;
24+
justify-content: center;
25+
/* Make content take up available space to center it when the close button is absolute */
26+
flex-grow: 1;
27+
padding-right: 24px; /* Add padding to avoid text overlapping with the close button */
28+
}
29+
30+
.bannerLink {
31+
color: black;
32+
text-decoration: none;
33+
white-space: nowrap; /* Prevents the link text from breaking */
34+
display: flex;
35+
align-items: center;
36+
gap: 0.25em;
37+
}
38+
39+
.bannerLink:hover {
40+
opacity: 0.6;
41+
}
42+
43+
.closeButton {
44+
background: none;
45+
border: none;
46+
padding: 4px;
47+
cursor: pointer;
48+
color: grey;
49+
border-radius: 50%;
50+
display: flex;
51+
transition: background-color 0.2s ease;
52+
/* Position button relative to the main container */
53+
position: absolute;
54+
right: 16px;
55+
top: 50%;
56+
transform: translateY(-50%);
57+
}
58+
59+
.closeButton:hover {
60+
background-color: rgba(0, 0, 0, 0.2);
61+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"use client";
2+
3+
import React, { useState, useEffect, useRef } from 'react';
4+
import styles from './LegacySiteBanner.module.css';
5+
6+
export default function LegacySiteBanner() {
7+
const [isVisible, setIsVisible] = useState<boolean>(false);
8+
const bannerRef = useRef<HTMLDivElement>(null);
9+
10+
useEffect(() => {
11+
const isDismissed = sessionStorage.getItem('legacyBannerDismissed');
12+
if (isDismissed !== 'true') {
13+
setIsVisible(true);
14+
}
15+
}, []);
16+
17+
useEffect(() => {
18+
if (isVisible && bannerRef.current) {
19+
const bannerHeight = bannerRef.current.offsetHeight;
20+
document.documentElement.style.setProperty('--banner-height', `${bannerHeight}px`);
21+
}
22+
23+
// This is a cleanup function. It runs when the banner is closed or hidden.
24+
return () => {
25+
document.documentElement.style.removeProperty('--banner-height');
26+
};
27+
}, [isVisible]);
28+
29+
const handleClose = (): void => {
30+
setIsVisible(false);
31+
sessionStorage.setItem('legacyBannerDismissed', 'true');
32+
};
33+
34+
if (!isVisible) {
35+
return null;
36+
}
37+
38+
return (
39+
<div ref={bannerRef} className={styles.bannerContainer}>
40+
<div className={styles.bannerContent}>
41+
<span>Looking for the legacy documentation site?</span>
42+
<a href="https://help.cloudsmith.io" target="_blank" rel="noopener noreferrer" className={styles.bannerLink}>
43+
Visit help.cloudsmith.io <svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="m8.537 12.938 4.596-4.084V7.13L8.537 3.062l-.663.75 4.162 3.682h-9.17v1h9.166L7.873 12.19l.664.748Z" fill="currentColor"></path>
44+
</svg>
45+
</a>
46+
47+
</div>
48+
<button onClick={handleClose} aria-label="Close this banner" className={styles.closeButton}>
49+
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
50+
<path d="M7.293 8 4.11 11.182l.707.707L8 8.707l3.182 3.182.707-.707L8.707 8l3.182-3.182-.707-.707L8 7.293 4.818 4.11l-.707.707L7.293 8Z" />
51+
</svg>
52+
</button>
53+
</div>
54+
);
55+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import LegacySiteBanner from './LegacySiteBanner';
2+
3+
export default LegacySiteBanner;

src/components/Navbar/Navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const Navbar = () => {
3535

3636
return (
3737
<>
38-
<div className={cx(styles.root, { [styles.isHome]: pathname === '/' })}>
38+
<div className={cx('main-header', styles.root, { [styles.isHome]: pathname === '/' })}>
3939
<Container className={styles.container}>
4040
<div className={styles.top}>
4141
<div className={styles.left}>

src/content/about-cloudsmith/common-use-cases.mdx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { Card, Flex } from '@/components';
22

33
# Common Use Cases
44

5-
This section outlines the primary and supporting use cases for Cloudsmith, detailing the benefits and key features for each:
5+
This section outlines the primary and supporting use cases for Cloudsmith, detailing the benefits and key features for each.
66

77
<Flex gap="s" align="stretch">
88
<Card
99
title="Artifact Management for the SDLC"
1010
description="Centralized storage, management, and control of all software artifacts in one location."
11-
href="/about-cloudsmith/common-use-cases#artifact-management-for-the-software-development-lifecycle-sdlc"
11+
href="/artifact-management"
1212
icon="homepage/documentation"
1313
type="simple"
1414
width="full"
@@ -17,7 +17,7 @@ This section outlines the primary and supporting use cases for Cloudsmith, detai
1717
<Card
1818
title="Software Distribution"
1919
description="A platform to securely and reliably distributing software to customers at scale."
20-
href="/about-cloudsmith/common-use-cases#software-distribution"
20+
href="/software-distribution"
2121
icon="homepage/api"
2222
type="simple"
2323
width="full"
@@ -26,7 +26,7 @@ This section outlines the primary and supporting use cases for Cloudsmith, detai
2626
<Card
2727
title="Software Supply Chain Security"
2828
description="Identify and mitigate security vulnerabilities and license compliance risks."
29-
href="/about-cloudsmith/common-use-cases#software-supply-chain-security"
29+
href="/supply-chain-security"
3030
icon="homepage/api"
3131
type="simple"
3232
width="full"
@@ -35,16 +35,13 @@ This section outlines the primary and supporting use cases for Cloudsmith, detai
3535
<Card
3636
title="Software Supply Chain Observability"
3737
description="Get insights about your artifact management and distribution workflows."
38-
href="/about-cloudsmith/common-use-cases#software-supply-chain-observability"
38+
href="/logs-and-observability"
3939
icon="homepage/api"
4040
type="simple"
4141
width="full"
4242
linkText=""
4343
/>
4444
</Flex>
45-
<br></br>
46-
47-
---
4845

4946
## Artifact Management for the Software Development Lifecycle (SDLC)
5047

src/content/about-cloudsmith/index.mdx

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,42 @@ Not sure where to start?
3434

3535
---
3636

37-
{/* TODO I think this three should go away from here, merging some of its contents into the new common use cases section */}
3837
<Flex gap="s" align="stretch">
3938
<Card
40-
title="For Developers"
41-
description="Dependencies"
42-
href="/about-cloudsmith/dependencies-for-developers"
43-
icon="homepage/guide"
39+
title="Artifact Management for the SDLC"
40+
description="Centralized storage, management, and control of all software artifacts in one location."
41+
href="/artifact-management"
42+
icon="homepage/documentation"
4443
type="simple"
4544
width="full"
45+
linkText="Rego-based Policies-as-Code"
4646
/>
4747
<Card
48-
title="For Operations"
49-
description="Deployment"
50-
href="/about-cloudsmith/deployment-for-operations"
51-
icon="homepage/guide"
48+
title="Software Distribution"
49+
description="A platform to securely and reliably distributing software to customers at scale."
50+
href="/software-distribution"
51+
icon="homepage/api"
5252
type="simple"
5353
width="full"
54+
linkText="Reduce risks"
5455
/>
5556
<Card
56-
title="For Vendors"
57-
description="Distribution"
58-
href="./software-distribution"
59-
icon="homepage/guide"
57+
title="Software Supply Chain Security"
58+
description="Identify and mitigate security vulnerabilities and license compliance risks."
59+
href="/supply-chain-security"
60+
icon="homepage/api"
61+
type="simple"
62+
width="full"
63+
linkText="Secure your artifacts."
64+
/>
65+
<Card
66+
title="Software Supply Chain Observability"
67+
description="Get insights about your artifact management and distribution workflows."
68+
href="/logs-and-observability"
69+
icon="homepage/api"
6070
type="simple"
6171
width="full"
72+
linkText=""
6273
/>
6374
</Flex>
6475

src/content/artifact-management/package-upload.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,20 @@ Please see [Package Tags](/artifact-management/package-tags) for more informatio
7272

7373
## Upload via Cloudsmith API
7474

75-
Uploading a package to Cloudsmith via the URL is a 2 step process
75+
Follow the next steps to upload a package to Cloudsmith via API:
7676

77-
1. A PUT req against the upload URL:
77+
1. A PUT req against the upload URL:
7878

7979
```
8080
https://upload.cloudsmith.io/OWNER/REPOSITORY/PACKAGE_NAME
8181
```
8282

8383
The response to this PUT req gives you an identifier that you will need for the next stage.
8484

85+
<Note variant="note" headline="Single-use Identifier">
86+
The identifier returned from the PUT request is for single-use only. You must make a new PUT request to get a new identifier for each file you wish to upload.
87+
</Note>
88+
8589
2. A POST req to create package endpoint
8690

8791
```
@@ -103,7 +107,7 @@ https://upload.cloudsmith.io/OWNER/REPOSITORY/PACKAGE_NAME
103107
2. Switch to the ‘Authorization’ tab and populate your credentials with either Basic Auth or your API Key
104108
3. Switch to the ‘Body’ tab and upload the file as a binary.
105109
4. Press send and receive the response.
106-
5. Read the identifier from the response to use in the next stage (see the image below, highlighted _5_)
110+
5. Read the identifier (single-use) from the response to use in the next stage (see the image below, highlighted _5_)
107111

108112
<BlockImage src={img2728021_Screenshot_2022_03_28_at_18_05_32} alt=""></BlockImage>
109113

0 commit comments

Comments
 (0)