Skip to content

Commit 75db697

Browse files
committed
refactor: JDE feedbacks on labels and content
1 parent 8fe9ae2 commit 75db697

14 files changed

Lines changed: 76 additions & 111 deletions

File tree

crowdsec-docs/docusaurus.config.ts

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import sidebarsUnversioned from "./sidebarsUnversioned";
88

99
const extractPreprocessor = require("./plugins/extract-preprocessor");
1010

11-
const generateCurrentAndNextRedirects = (
12-
s: string,
13-
): { from: string; to: string }[] => [
11+
const generateCurrentAndNextRedirects = (s: string): { from: string; to: string }[] => [
1412
{
1513
from: `/docs/${s}`,
1614
to: `/u/${s}`,
@@ -21,7 +19,9 @@ const generateCurrentAndNextRedirects = (
2119
},
2220
];
2321

24-
function handleSidebarItems(items: any[]): any[] {
22+
type SidebarItem = string | { id?: string; link?: { id?: string }; items?: SidebarItem[] };
23+
24+
function handleSidebarItems(items: SidebarItem[]): { from: string; to: string }[] {
2525
const arr = [];
2626
for (const item of items) {
2727
if (typeof item === "string") {
@@ -34,7 +34,7 @@ function handleSidebarItems(items: any[]): any[] {
3434
}
3535

3636
// This function generates redirects for all items in the unversioned sidebars, so that if we move a doc from versioned to unversioned, we don't break existing links. It handles both string items (doc ids) and nested objects (categories with their own items).
37-
const backportRedirect = (s: any): any[] => {
37+
const backportRedirect = (s: SidebarItem): { from: string; to: string }[] => {
3838
const arr = [];
3939
if (typeof s === "string") {
4040
arr.push(...generateCurrentAndNextRedirects(s));
@@ -56,9 +56,7 @@ const backportRedirect = (s: any): any[] => {
5656
const currentYear = new Date().getFullYear();
5757

5858
const ACADEMY_URL = `https://academy.crowdsec.net/courses?${
59-
process.env.NODE_ENV === "production"
60-
? "utm_source=docs&utm_medium=menu&utm_campaign=top-menu&utm_id=academydocs"
61-
: ""
59+
process.env.NODE_ENV === "production" ? "utm_source=docs&utm_medium=menu&utm_campaign=top-menu&utm_id=academydocs" : ""
6260
}`;
6361

6462
/** IF you make significant changes to the nav bar or side bars
@@ -241,11 +239,7 @@ const redirects = [
241239
function redirectsGlobalDataPlugin() {
242240
return {
243241
name: "redirects-global-data",
244-
async contentLoaded({
245-
actions,
246-
}: {
247-
actions: { setGlobalData: (data: unknown) => void };
248-
}) {
242+
async contentLoaded({ actions }: { actions: { setGlobalData: (data: unknown) => void } }) {
249243
actions.setGlobalData({ redirects });
250244
},
251245
};
@@ -259,8 +253,7 @@ const config: Config = {
259253
experimental_faster: true,
260254
},
261255
title: "CrowdSec",
262-
tagline:
263-
"CrowdSec - Real-time & crowdsourced protection against aggressive IPs",
256+
tagline: "CrowdSec - Real-time & crowdsourced protection against aggressive IPs",
264257
url: "https://docs.crowdsec.net",
265258
baseUrl: "/",
266259
onBrokenLinks: "warn",
@@ -341,8 +334,7 @@ const config: Config = {
341334
{
342335
docs: {
343336
sidebarPath: "./sidebars.ts",
344-
editUrl:
345-
"https://github.com/crowdsecurity/crowdsec-docs/edit/main/crowdsec-docs/",
337+
editUrl: "https://github.com/crowdsecurity/crowdsec-docs/edit/main/crowdsec-docs/",
346338
lastVersion: "current",
347339
versions: {
348340
"v1.7": {
@@ -360,8 +352,7 @@ const config: Config = {
360352
},
361353
blog: {
362354
showReadingTime: true,
363-
editUrl:
364-
"https://github.com/crowdsecurity/crowdsec-docs/edit/main/crowdsec-docs/",
355+
editUrl: "https://github.com/crowdsecurity/crowdsec-docs/edit/main/crowdsec-docs/",
365356
},
366357
theme: {
367358
customCss: "./src/css/custom.css",
@@ -412,14 +403,12 @@ const config: Config = {
412403
{
413404
title: "CrowdSec Hub",
414405
url: "https://hub.crowdsec.net/",
415-
description:
416-
"Browse and install parsers, scenarios, collections, and remediation components",
406+
description: "Browse and install parsers, scenarios, collections, and remediation components",
417407
},
418408
{
419409
title: "CrowdSec Console",
420410
url: "https://app.crowdsec.net/",
421-
description:
422-
"Manage your CrowdSec deployments and access the community blocklist",
411+
description: "Manage your CrowdSec deployments and access the community blocklist",
423412
},
424413
{
425414
title: "GitHub Repository",

crowdsec-docs/plugins/gtag/theme/cookieconsent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function CookieConsent() {
88
if (dismissed) return null;
99

1010
return (
11-
<div className="fixed bottom-6 right-6 w-80 rounded-[14px] bg-cs-surface border border-cs-border-hi z-[9999] flex flex-col gap-3.5 p-5 pb-4"
11+
<div className="fixed bottom-6 left-6 w-80 rounded-[14px] bg-cs-surface border border-cs-border-hi z-[9999] flex flex-col gap-3.5 p-5 pb-4"
1212
style={{ boxShadow: "0 16px 48px rgba(0,0,0,0.35), 0 0 0 1px rgba(148,163,184,0.06)" }}
1313
>
1414
{/* Eyebrow */}

crowdsec-docs/sidebarsUnversioned.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,6 @@ const sidebarsUnversionedConfig: SidebarConfig = {
451451
tag: "otherSection",
452452
},
453453
},
454-
{
455-
type: "doc",
456-
label: "IP Reputation Report",
457-
id: "console/ip_reputation/ip_report",
458-
},
459454
],
460455
},
461456
{

crowdsec-docs/src/components/docs/AccessCard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function AccessCard({ icon, title, command, ctaLabel, ctaHref }:
4242
)}
4343
<a
4444
href={ctaHref}
45-
className="inline-flex items-center gap-1.5 py-2 px-[18px] rounded-[7px] bg-cs-orange text-[#0a1120] text-[13px] font-semibold no-underline transition-opacity duration-150 self-start hover:opacity-[0.85] hover:no-underline hover:text-[#0a1120]"
45+
className="cs-btn inline-flex items-center gap-1.5 py-2 px-[18px] rounded-[7px] bg-cs-orange text-cs-btn-text text-[13px] font-semibold no-underline self-start hover:no-underline hover:text-cs-btn-text"
4646
>
4747
{ctaLabel}
4848
</a>

crowdsec-docs/src/components/docs/DocCard/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default function DocCard({
6363

6464
const card = (
6565
<div
66-
className={`p-5 rounded-xl bg-cs-surface border border-cs-border flex flex-col gap-3 h-full${href ? " transition-[border-color,box-shadow] duration-150" : ""}`}
66+
className={`p-5 rounded-xl ease-in-out bg-cs-surface border border-cs-border no-underline hover:no-underline flex flex-col gap-3 h-full${href ? " transition-[border-color,box-shadow] duration-150" : ""}`}
6767
>
6868
<div className="flex items-start gap-3">
6969
{resolvedIcon && (
@@ -119,7 +119,7 @@ export default function DocCard({
119119
<a
120120
key={l.href}
121121
href={l.href}
122-
className="text-[12.5px] font-semibold no-underline inline-flex items-center gap-1"
122+
className="text-[12.5px] font-semibold no-underline hover:no-underline inline-flex items-center gap-1"
123123
style={{ color }}
124124
>
125125
{l.label}
@@ -131,7 +131,7 @@ export default function DocCard({
131131

132132
{/* CTA — explicit label, or auto arrow footer for href-only clickable cards */}
133133
{href && (ctaLabel || (!links?.length && !command)) && (
134-
<div className="mt-auto pt-3 border-t border-dashed border-cs-border flex items-center justify-between">
134+
<div className="mt-auto pt-3 border-t border-cs-border flex items-center justify-between">
135135
<span className="text-[12.5px] font-semibold inline-flex items-center gap-[5px]" style={{ color }}>
136136
{ctaLabel ?? title} <ArrowRight />
137137
</span>
@@ -142,7 +142,7 @@ export default function DocCard({
142142

143143
if (href && !ctaLabel && !links) {
144144
return (
145-
<a href={href} className="no-underline block">
145+
<a href={href} className="no-underline hover:no-underline block">
146146
{card}
147147
</a>
148148
);

crowdsec-docs/src/components/docs/GuidedSetupCard/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ export default function GuidedSetupCard({ title, desc, primaryCta, secondaryCta
3434
<div className="flex gap-[10px] flex-wrap shrink-0">
3535
<a
3636
href={primaryCta.href}
37-
className="py-[10px] px-4 rounded-[9px] bg-cs-violet text-cs-btn-text font-semibold text-[13.5px] no-underline inline-flex items-center gap-2 shadow-[0_8px_24px_color-mix(in_srgb,var(--cs-violet)_30%,transparent)]"
37+
className="cs-btn py-[10px] px-4 rounded-[9px] bg-cs-violet text-cs-btn-text font-semibold text-[13.5px] no-underline hover:no-underline hover:text-cs-btn-text inline-flex items-center gap-2 shadow-[0_8px_24px_color-mix(in_srgb,var(--cs-violet)_30%,transparent)]"
3838
>
3939
<CIcon icon={cilCompass} style={{ width: 14, height: 14 }} />
4040
{primaryCta.label}
4141
</a>
4242
{secondaryCta && (
4343
<a
4444
href={secondaryCta.href}
45-
className="py-[10px] px-4 rounded-[9px] bg-cs-surface-2 text-cs-ink font-semibold text-[13.5px] border border-cs-border-hi no-underline inline-flex items-center gap-2"
45+
className="cs-btn py-[10px] px-4 rounded-[9px] bg-cs-surface-2 text-cs-ink font-semibold text-[13.5px] border border-cs-border-hi no-underline hover:no-underline hover:text-cs-ink inline-flex items-center gap-2"
4646
>
4747
<CIcon icon={cilBolt} style={{ width: 14, height: 14 }} />
4848
{secondaryCta.label}

crowdsec-docs/src/components/docs/PathCard/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,12 @@ export default function PathCard({ eyebrow, color, icon, title, desc, tag, tags
9595
)}
9696

9797
{audience && (
98-
<div className="font-cs-mono text-[10.5px] text-cs-ink-mute tracking-[0.06em] leading-[1.4] min-w-0 overflow-hidden mt-4">
99-
{audience}
100-
</div>
101-
)}
98+
<div className="font-cs-mono text-[10.5px] text-cs-ink-mute tracking-[0.06em] leading-[1.4] min-w-0 overflow-hidden mt-4">
99+
{audience}
100+
</div>
101+
)}
102102

103103
<div className="mt-3 pt-4 border-t border-cs-border flex items-center justify-between">
104-
105104
<div
106105
className="inline-flex items-center gap-1.5 font-semibold text-[13px] ml-auto whitespace-nowrap shrink-0 transition-[gap] duration-[160ms]"
107106
style={{ color }}

crowdsec-docs/src/components/docs/PathwayRow/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default function PathwayRow({ color, title, eyebrow, sub, steps, ctaLabel
9898
<a
9999
href={ctaHref}
100100
onClick={(e) => e.stopPropagation()}
101-
className="py-2 px-[14px] rounded-lg font-semibold text-[13px] inline-flex items-center gap-1.5 no-underline shrink-0 whitespace-nowrap"
101+
className="cs-btn py-2 px-[14px] rounded-lg font-semibold text-[13px] inline-flex items-center gap-1.5 no-underline hover:no-underline shrink-0 whitespace-nowrap"
102102
style={{
103103
background: color,
104104
color: "var(--cs-btn-text)",
@@ -169,7 +169,7 @@ export default function PathwayRow({ color, title, eyebrow, sub, steps, ctaLabel
169169
{/* CTA in content when OPEN */}
170170
<a
171171
href={ctaHref}
172-
className="inline-flex items-center gap-1.5 py-2 px-[18px] rounded-[7px] text-[13px] font-semibold no-underline whitespace-nowrap"
172+
className="cs-btn inline-flex items-center gap-1.5 py-2 px-[18px] rounded-[7px] text-[13px] font-semibold no-underline hover:no-underline whitespace-nowrap"
173173
style={{
174174
background: color,
175175
color: "var(--cs-btn-text)",

crowdsec-docs/src/components/docs/PromoCard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export default function PromoCard({ variant = "console" }: Props) {
126126
</div>
127127
<a
128128
href={data.ctaHref}
129-
className="inline-flex items-center justify-center w-full py-[10px] px-[14px] rounded-lg text-[13px] font-bold no-underline transition-opacity duration-150 mt-1 tracking-[0.01em] hover:opacity-[0.88] hover:no-underline"
129+
className="cs-btn inline-flex items-center justify-center w-full py-[10px] px-[14px] rounded-lg text-[13px] font-bold no-underline mt-1 tracking-[0.01em] hover:no-underline"
130130
style={{ background: data.color, color: "var(--cs-btn-text)" }}
131131
>
132132
{data.ctaLabel} <CIcon icon={cilArrowRight} style={{ width: 13, height: 13 }} aria-hidden="true" />

crowdsec-docs/src/components/home-page/quick-start.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import cibWindows from "@site/static/img/logo/windows-colored.svg";
1010
import opnsenseLogo from "@site/static/img/logo-opnsense.svg";
1111
import pfSenseLogo from "@site/static/img/logo-pfsense.svg";
1212
import whmLogo from "@site/static/img/logo-whm.svg";
13-
import React from "react";
13+
import type React from "react";
1414
import { HomePageItem } from "./home-item";
1515

1616
type StaticData = {
17-
icon: React.ComponentType<React.SVGProps<SVGSVGElement>>;
17+
icon: React.ElementType | React.ReactNode;
1818
text: string;
1919
link: string;
2020
description?: string;

0 commit comments

Comments
 (0)