Skip to content

Commit

Permalink
Merge pull request #714 from crowdsecurity/update-doc-ui
Browse files Browse the repository at this point in the history
feat: 📝 Update home documentation UI
  • Loading branch information
ziracmo authored Jan 14, 2025
2 parents 76e8cf4 + 4bda4f4 commit 3c99062
Show file tree
Hide file tree
Showing 19 changed files with 638 additions and 144 deletions.
16 changes: 8 additions & 8 deletions crowdsec-docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const backportRedirect = (s) => {
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
future: {
experimental_faster: true,
experimental_faster: true,
},
title: "CrowdSec",
tagline:
Expand Down Expand Up @@ -88,11 +88,11 @@ module.exports = {
contextualSearch: true,
},
zooming: {
selector: '.markdown :not(a) > img',
selector: ".markdown :not(a) > img",
delay: 500,
background: {
light: 'rgba(101,108,133,0.8)',
dark: 'rgba(9,10,17,0.8)'
light: "rgba(101,108,133,0.8)",
dark: "rgba(9,10,17,0.8)",
},
},
navbar: {
Expand Down Expand Up @@ -266,12 +266,12 @@ module.exports = {
versions: {
"v1.6.0": {
banner: "none",
path: "/"
path: "/",
},
current: {
path: "/next"
}
}
path: "/next",
},
},
},
blog: {
showReadingTime: true,
Expand Down
121 changes: 121 additions & 0 deletions crowdsec-docs/src/components/GetToKnowUs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import Link from "@docusaurus/Link"

const staticData = [
{
icon: () => (
<img
src="/img/crowdsec_logo.png"
className="tw-h-6 tw-w-9"
alt="CrowdSec logo"
/>
),
title: "What is CrowdSec?",
description:
"Data curated solution with a bunch of millions IPs detected by our large community.",
link: "https://www.crowdsec.net",
},
{
icon: () => (
<img
src="/img/icons/radar-target.webp"
className="tw-h-6 tw-w-6"
alt="security engines"
/>
),
title: "Security Engines",
description: "Secure yourself.",
link: "/docs/intro",
},
{
icon: () => <span className="tw-text-2xl">🖥️</span>,
title: "CrowdSec Console",
description: "Manage and monitor your security.",
link: "/u/console/intro",
},
{
icon: () => <span className="tw-text-2xl">🧑🏻‍💻</span>,
title: "CrowdSec CLI",
description: "Use our command line interface.",
link: "/docs/cscli/",
},
{
icon: () => (
<img
src="/img/icons/waf.webp"
className="tw-h-6 tw-w-6"
alt="Web application firewall"
/>
),
title: "CrowdSec WAF",
description: "Protect your web applications.",
link: "/docs/appsec/intro",
},
{
icon: () => (
<img
src="/img/icons/shield.webp"
className="tw-h-6 tw-w-6"
alt="blocklists"
/>
),
title: "Blocklists",
description: "Block thousands of IPs.",
link: "/u/blocklists/intro",
},
{
icon: () => (
<img
src="/img/icons/world.webp"
className="tw-h-6 tw-w-6"
alt="world API"
/>
),
title: "APIs",
description: "Integrate with your tools.",
link: "/u/cti_api/intro",
},
]

export default function GetToKnowUs() {
return (
<section>
<h2 className="tw-text-left tw-text-white">Get to know us!</h2>

<div className="tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-4">
{staticData.map((props, index) => (
<Link
key={props.text}
href={props.link}
className={
"tw-border-0 hover:tw-no-underline " +
(index === 0 ? "md:tw-col-span-2" : "")
}
>
<div
className={
"tw-w-full tw-flex tw-justify-start tw-items-start tw-border tw-border-transparent tw-flex-row tw-rounded-lg tw-px-2 tw-py-2 tw-gap-2 tw-flex-1 tw-cursor-pointer tw-bg-gray-800 tw-ease-in-out tw-text-white tw-duration-300 hover:tw-border-white hover:tw-bg-gray-700"
}
>
<span className="tw-border-2 tw-border-gray-700 tw-bg-alpa-primary tw-w-12 tw-h-12 tw-rounded-lg tw-inline-flex tw-items-center tw-justify-center">
<props.icon className="icon icon-xl" />
</span>

<div className="tw-flex tw-flex-col tw-items-start tw-flex-1">
<span
className={
"tw-text-md tw-font-bold tw-flex-1"
}
>
{props.title}
</span>
<p className="tw-text-sm tw-text-left tw-text-gray-300 tw-mb-0">
{props.description}
</p>
</div>
</div>
</Link>
))}
</div>
</section>
)
}
96 changes: 56 additions & 40 deletions crowdsec-docs/src/components/QuickStart.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import CIcon from "@coreui/icons-react";
import {
cibKubernetes,
cibDocker,
cibLinux,
cibFreebsd,
cibWindows,
cibApple,
} from "@coreui/icons";
import opnsenseLogo from "@site/static/img/logo-opnsense.svg";
import pfSenseLogo from "@site/static/img/logo-pfsense.svg";
import whmLogo from "@site/static/img/logo-whm.svg";
import cloudwaysLogo from "@site/static/img/logo-cloudways.svg";
import Link from "@docusaurus/Link";
import CIcon from "@coreui/icons-react"
import cibLinux from "@site/static/img/logo/linux-colored.svg"
import cibDocker from "@site/static/img/logo/docker-colored.svg"
import cibWindows from "@site/static/img/logo/windows-colored.svg"
import cibFreebsd from "@site/static/img/logo/freebsd-colored.svg"
import cibApple from "@site/static/img/logo/apple-colored.svg"
import opnsenseLogo from "@site/static/img/logo-opnsense.svg"
import pfSenseLogo from "@site/static/img/logo-pfsense.svg"
import cibKubernetes from "@site/static/img/logo/kubernetes-colored.svg"
import whmLogo from "@site/static/img/logo-whm.svg"
import cloudwaysLogo from "@site/static/img/logo-cloudways.svg"
import Link from "@docusaurus/Link"

const staticData = [
{
Expand Down Expand Up @@ -65,37 +63,55 @@ const staticData = [
// text: "Cloudways",
// link: "/u/getting_started/installation/cloudways",
// },
];
]

export default function QuickStart() {
return (
<>
<div className="tw-flex tw-flex-col tw-items-center tw-border-2 tw-border-white tw-border-solid tw-rounded-xl tw-2-4/5 sm:tw-w-2/3 tw-m-auto tw-transition tw-duration-500 tw-ease-in-out tw-transform hover:tw-border-secondary">
<h1 className="tw-text-2xl tw-border-white tw-border-solid tw-rounded-xl tw-px-8 tw-bg-black tw--translate-y-4">
Quick Start
</h1>
<div className="tw-flex tw-flex-row tw-gap-14 tw-px-8 tw-flex-wrap">
{staticData.map((item, index) => (
<div className="tw-w-full md:tw-w-fit tw-transition tw-duration-500 tw-ease-in-out tw-transform hover:tw-border-secondary">
<Link
key={index}
to={item.link}
className="tw-flex tw-flex-col tw-items-center tw-text-white tw-transition tw-duration-500 tw-ease-in-out tw-transform hover:tw-text-secondary"
<section>
<div className="tw-text-left">
<h2 className="tw-mb-1 tw-text-white">
Select your environment
</h2>
<p className="tw-max-w-xl tw-text-sm tw-text-gray-300">
We can secure your stack. Just select your platform and get
started.
</p>
</div>

<div className="tw-grid tw-grid-cols-1 md:tw-grid-cols-3 tw-gap-4 tw-mt-4">
{staticData.map((props) => (
<Link
key={props.text}
href={props.link}
className="tw-border-0 hover:tw-no-underline"
>
<div
className={
"tw-w-full tw-flex tw-justify-start tw-items-center tw-border tw-border-transparent tw-flex-row tw-rounded-lg tw-px-2 tw-py-2 tw-gap-2 tw-flex-1 tw-cursor-pointer tw-bg-gray-800 tw-ease-in-out tw-text-white tw-duration-300 hover:tw-border-white hover:tw-bg-gray-700"
}
>
<span className="tw-border-2 tw-border-gray-700 tw-bg-alpa-primary tw-w-12 tw-h-12 tw-rounded-lg tw-inline-flex tw-items-center tw-justify-center">
{(!Array.isArray(props.icon) && (
<props.icon className="icon icon-xl" />
)) || <CIcon icon={props.icon} size="xl" />}
</span>

<span
className={
"tw-text-md tw-font-semibold tw-flex-1 tw-text-left"
}
>
{(!Array.isArray(item.icon) && (
<item.icon className="icon icon-4xl" />
)) || <CIcon icon={item.icon} size="4xl" />}
{!!item.text && <p className="tw-text-xl">{item.text}</p>}
</Link>
{props.text}
</span>
</div>
))}
</div>
</Link>
))}
</div>
<p className="tw-text-xs tw-my-1">
**Logos and trademarks, such as the logos above, are the
property of their respective owners and are used here for
identification purposes only.
<p className="tw-text-xs tw-my-1 tw-text-gray-300 tw-text-right">
*Logos and trademarks, such as the logos above, are the property
of their respective owners and are used here for identification
purposes only.
</p>
</>
);
</section>
)
}
Loading

0 comments on commit 3c99062

Please sign in to comment.