Skip to content

Commit 14138fb

Browse files
authored
Merge pull request #171 from aboutcode-org/refinements3
Streamline homepage
2 parents 82e2945 + f9ede0a commit 14138fb

6 files changed

Lines changed: 205 additions & 32 deletions

File tree

website/docusaurus.config.js

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@
55
// See: https://docusaurus.io/docs/api/docusaurus-config
66

77
import { themes as prismThemes } from 'prism-react-renderer';
8+
import { execSync } from 'node:child_process';
9+
10+
// Run git to get versions, and commit date when buildingg.
11+
// Fall-back to defaulst for non-git clones/tarballs/plain dir upload
12+
function vcs_info() {
13+
const run = (cmd) => execSync(cmd, { encoding: 'utf8' }).trim();
14+
try {
15+
return {
16+
version: run('git describe --always --tags --dirty'),
17+
commit_date: run('git log -1 --format=%cI'),
18+
// also strip trailing slash
19+
repo_url: run('git config --get remote.origin.url').replace(/\/$/, ''),
20+
};
21+
} catch {
22+
return {
23+
version: 'unknown',
24+
commit_date: '',
25+
repo_url: 'https://github.com/aboutcode-org/www.aboutcode.org',
26+
};
27+
}
28+
}
829

930
// Deployment target: local | gh | dreamhost
1031
/** @type {'local' | 'gh' | 'dreamhost'} */
@@ -35,13 +56,19 @@ const siteConfig = {
3556
// Define const for the footer icon paths.
3657
const currentBaseUrl = siteConfig[deployTarget].baseUrl
3758

59+
const vcs = vcs_info();
60+
const buildLine = vcs.version === 'unknown'
61+
? ''
62+
: `<div class="footer__build">Built with Docusaurus from <a href="${vcs.repo_url}" target="_blank" rel="noopener noreferrer">${vcs.repo_url} @ ${vcs.version}</a> on ${vcs.commit_date}</div>`;
63+
3864
/** @type {import('@docusaurus/types').Config} */
3965
const config = {
4066
title: 'AboutCode.org',
4167
tagline: 'Open data, tools, and standards for the software supply chains',
4268
favicon: 'img/favicon.ico',
4369

4470

71+
4572
markdown: {
4673
format: 'detect', // Auto-detects: .md = plain Markdown (CommonMark), .mdx = MDX
4774
hooks: {
@@ -133,6 +160,10 @@ const config = {
133160
label: 'Projects',
134161
position: 'left'
135162
},
163+
{ to: '/environments',
164+
label: 'Environments',
165+
position: 'left'
166+
},
136167
{
137168
type: 'dropdown',
138169
label: 'About',
@@ -196,7 +227,7 @@ const config = {
196227
{ label: 'Terms of Use', to: '/terms' },
197228
{ label: 'Credits', to: '/docs/about/credits' },
198229
],
199-
copyright: `Copyright AboutCode Europe ASBL. &nbsp; Content licensed under CC-BY-SA-4.0. &nbsp; Built with Docusaurus.`,
230+
copyright: `Copyright (c) AboutCode Europe ASBL. &nbsp; Content licensed under CC-BY-SA-4.0.${buildLine}`,
200231
},
201232
prism: {
202233
theme: prismThemes.github,

website/src/components/EcosystemGrid/index.js

Lines changed: 74 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,17 @@ function GridItem({ item }) {
229229
);
230230
}
231231

232-
function GridSection({ id, title, items, header_link, intro }) {
232+
233+
// Grid section comes either as a summary with see all link, or no link for
234+
// the full envt. page
235+
function GridSection({ id, title, items, header_link, intro, see_all }) {
233236
const headerLinkHref = useBaseUrl(header_link?.url || '/');
237+
const seeAllHref = useBaseUrl(see_all?.url || '/');
238+
239+
const introWithSeeAll = intro && see_all
240+
? React.cloneElement(intro, {}, ...React.Children.toArray(intro.props.children), ' ',
241+
<a key="see-all" href={seeAllHref} className={styles.seeAll}>{see_all.label}.</a>)
242+
: intro;
234243
return (
235244
<div id={id} className={styles.section}>
236245
<h3 className={styles.sectionTitle}>
@@ -239,7 +248,7 @@ function GridSection({ id, title, items, header_link, intro }) {
239248
<>{' - '}<a href={headerLinkHref} className={styles.header_link}>{header_link.label}...</a></>
240249
)}
241250
</h3>
242-
{intro && <div className={styles.intro}>{intro}</div>}
251+
{introWithSeeAll && <div className={styles.intro}>{introWithSeeAll}</div>}
243252
<div className={styles.grid}>
244253
{items.map((item) => (
245254
<GridItem key={item.label} item={item} />
@@ -249,7 +258,56 @@ function GridSection({ id, title, items, header_link, intro }) {
249258
);
250259
}
251260

252-
export default function EcosystemGrid() {
261+
// Feature only the most common on home, with links to see all.
262+
263+
const featured_licenses = [
264+
'MIT', 'Apache-2.0', 'GPL-2.0', 'GPL-3.0', 'BSD-2-Clause',
265+
'BSD-3-Clause', 'LGPL-2.0', 'LGPL-2.1', 'LGPL-3.0',
266+
].map((label) => licenses.find((v) => v.label === label));
267+
268+
const featured_vulnerability_sources = [
269+
'NVD', 'CVE', 'GitHub Advisories', 'GitLab Advisories', 'OSV.dev',
270+
'npm Advisories', 'PyPA', 'Ruby Advisory DB', 'Rust Advisory DB',
271+
].map((label) => vulnerability_sources.find((v) => v.label === label));
272+
273+
const featured_package_ecosystems = [
274+
'npm', 'PyPI', 'Maven', 'NuGet', 'RubyGems',
275+
'Cargo', 'Composer', 'Conda', 'Docker',
276+
].map((label) => package_ecosystems.find((v) => v.label === label));
277+
278+
279+
export default function EcosystemGrid({ featured = false }) {
280+
if (featured) {
281+
return (
282+
<div className={styles.gridWrapper}>
283+
<GridSection
284+
id="licensing"
285+
title="Licenses"
286+
items={featured_licenses}
287+
header_link={{ label: 'Get started with license compliance', url: '/docs/getting_started/license-compliance/' }}
288+
intro={<p>AboutCode tracks over 2,500+ curated licenses across 12 categories. Browse all <a href="https://scancode-licensedb.aboutcode.org" target="_blank" rel="noopener noreferrer">2,500+ licenses</a> in the LicenseDB. Industry-leading license detection is backed by <a href="https://github.com/aboutcode-org/scancode-toolkit/tree/develop/src/licensedcode/data/rules" target="_blank" rel="noopener noreferrer">over 35,000 license notices</a> used as detection rules.</p>}
289+
see_all={{ label: 'See more supported licenses', url: '/environments/#licensing' }}
290+
/>
291+
<GridSection
292+
id="vuln-sources"
293+
title="Software vulnerabilities"
294+
items={featured_vulnerability_sources}
295+
header_link={{ label: 'Get started with software security', url: '/docs/getting_started/software-security/' }}
296+
intro={<p>AboutCode collects, correlates, and improves vulnerabilities from multiple advisory data sources, privileging upstream data.</p>}
297+
see_all={{ label: 'See more tracked vulnerability sources', url: '/environments/#vuln-sources' }}
298+
/>
299+
<GridSection
300+
id="pkg-ecosystems"
301+
title="Package ecosystems"
302+
items={featured_package_ecosystems}
303+
header_link={{ label: 'Get started with software identification', url: '/docs/getting_started/software-identification/' }}
304+
intro={<p>The AboutCode package database and scanners track millions of packages from most package ecosystems.</p>}
305+
see_all={{ label: 'See more supported package ecosystems', url: '/environments/#pkg-ecosystems' }}
306+
/>
307+
</div>
308+
);
309+
}
310+
253311
return (
254312
<div className={styles.gridWrapper}>
255313
<GridSection
@@ -259,6 +317,13 @@ export default function EcosystemGrid() {
259317
header_link={{ label: 'Get started with license compliance', url: '/docs/getting_started/license-compliance/' }}
260318
intro={<p>AboutCode tracks over 2,500+ curated licenses across 12 categories. Browse all <a href="https://scancode-licensedb.aboutcode.org" target="_blank" rel="noopener noreferrer">2,500+ licenses</a> in the LicenseDB. Industry-leading license detection is backed by <a href="https://github.com/aboutcode-org/scancode-toolkit/tree/develop/src/licensedcode/data/rules" target="_blank" rel="noopener noreferrer">over 35,000 license notices</a> used as detection rules.</p>}
261319
/>
320+
<GridSection
321+
id="pkg-ecosystems"
322+
title="Package ecosystems"
323+
items={package_ecosystems}
324+
header_link={{ label: 'Get started with software identification', url: '/docs/getting_started/software-identification/' }}
325+
intro={<p>The AboutCode package database and scanners track millions of packages from most package ecosystems.</p>}
326+
/>
262327
<GridSection
263328
id="vuln-sources"
264329
title="Software vulnerabilities"
@@ -267,12 +332,12 @@ export default function EcosystemGrid() {
267332
intro={<p>AboutCode collects, correlates, and improves vulnerabilities from multiple advisory data sources, privileging upstream data. </p>}
268333
/>
269334
<GridSection
270-
id="pkg-ecosystems"
271-
title="Package ecosystems"
272-
items={package_ecosystems}
273-
header_link={{ label: 'Get started with software identification', url: '/docs/getting_started/software-identification/' }}
274-
intro={<p>The AboutCode package database and scanners track millions of packages from most package ecosystems.</p>}
275-
/>
335+
id="vuln-reference-data"
336+
title="Vulnerability severity and other reference data"
337+
items={vulnerability_reference_data}
338+
header_link={{ label: 'Get started with software security', url: '/docs/getting_started/software-security/' }}
339+
intro={<p>AboutCode imports vulnerability reference data in key industry formats, mapping these to PURL. </p>}
340+
/>
276341
<GridSection
277342
id="operating-systems"
278343
title="Operating systems"
@@ -301,13 +366,6 @@ export default function EcosystemGrid() {
301366
header_link={{ label: 'Get started with software identification', url: '/docs/getting_started/software-identification/' }}
302367
intro={<p>AboutCode supports extraction of most archive, compressed, package, and disk image file formats.</p>}
303368
/>
304-
<GridSection
305-
id="vuln-reference-data"
306-
title="Vulnerability severity and other reference data"
307-
items={vulnerability_reference_data}
308-
header_link={{ label: 'Get started with software security', url: '/docs/getting_started/software-security/' }}
309-
intro={<p>AboutCode imports vulnerability reference data in key industry formats, mapping these to PURL. </p>}
310-
/>
311369
</div>
312370
);
313371
}

website/src/components/EcosystemGrid/styles.module.css

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,33 @@
138138
[data-theme='dark'] .cellLabel {
139139
color: #c8d0e0;
140140
}
141+
142+
.moreList {
143+
margin: 0.25rem 0 0 0;
144+
padding-left: 1.25rem;
145+
font-size: 0.9rem;
146+
line-height: 1.6;
147+
}
148+
149+
.moreList a {
150+
color: #2a6bc7;
151+
text-decoration: none;
152+
font-weight: 500;
153+
}
154+
155+
.moreList a:hover {
156+
text-decoration: underline;
157+
}
158+
159+
.moreCount {
160+
color: #6b7a99;
161+
font-size: 0.8rem;
162+
}
163+
164+
.moreSummary {
165+
color: #2b3a5e;
166+
}
167+
168+
[data-theme='dark'] .moreSummary {
169+
color: #c8d0e0;
170+
}

website/src/components/HomepageContent/index.js

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,6 @@ export default function HomepageContent() {
6868
<AdoptersBanner />
6969
</section>
7070

71-
<section className={styles.sectionContainer}>
72-
<div
73-
className={styles.sectionHeader}
74-
style={{ marginBottom: '15px', marginTop: '15px' }}
75-
>
76-
<h2>Supporters</h2>
77-
</div>
78-
<div className={styles.sectionIntro}>
79-
<Supporters />
80-
</div>
81-
</section>
82-
8371
<section id="standards" className={styles.sectionContainer}>
8472
<div
8573
className={styles.sectionHeader}
@@ -126,14 +114,34 @@ export default function HomepageContent() {
126114
className={styles.sectionHeader}
127115
style={{ marginBottom: '15px', marginTop: '15px' }}
128116
>
129-
<h2>Supported ecosystems, languages, licenses, and data sources</h2>
117+
<h2>Supported ecosystems, languages, licenses, and data sources - <Link to="/environments/" className={styles.headerLink}>See all environments</Link></h2>
130118
</div>
131119
<div className={styles.sectionIntro}>
132120
<p>AboutCode tools support a large number of licenses, package ecosystems, programming languages,
133121
and vulnerability data sources, all identified using{' '}
134-
<a href="https://packageurl.org">Package-URL (PURL)</a> or SPDX license expressions.</p>
122+
<a href="https://packageurl.org">Package-URL (PURL)</a> or SPDX license expressions.
123+
See a few highlights below; the full set of supported <Link to="/environments/">Environments</Link>
124+
also includes operating systems, programming languages, binary and archive formats, and more data sources.</p>
125+
</div>
126+
<EcosystemGrid featured />
127+
</section>
128+
129+
<section className={styles.sectionContainer}>
130+
<div
131+
className={styles.sectionHeader}
132+
style={{ marginBottom: '15px', marginTop: '15px' }}
133+
>
134+
<h2>Supporters</h2>
135+
</div>
136+
<div className={styles.sectionIntro}>
137+
<Supporters />
138+
<p>
139+
<Link to="/docs/about/meetings/">Join the conversation</Link>,{' '}
140+
<Link to="/docs/about/contribute/">or contribute</Link> to{' '}
141+
<Link to="/projects/">AboutCode projects</Link> to help make the software
142+
supply chains healthier and safer!
143+
</p>
135144
</div>
136-
<EcosystemGrid />
137145
</section>
138146

139147
<div style={{ marginBottom: '50px' }}></div>

website/src/css/custom.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,15 @@
8989
.footer {
9090
background-color: #2b3a5e;
9191
}
92+
93+
.footer__build {
94+
margin-top: 0.5rem;
95+
font-size: 0.75rem;
96+
opacity: 0.55;
97+
}
98+
99+
.footer__build a {
100+
color: inherit;
101+
border-bottom: 1px dotted currentColor;
102+
text-decoration: none;
103+
}

website/src/pages/environments.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React from 'react';
2+
import Layout from '@theme/Layout';
3+
import EcosystemGrid from '@site/src/components/EcosystemGrid';
4+
import styles from '@site/src/components/HomepageContent/styles.module.css';
5+
6+
export default function Environments() {
7+
return (
8+
<Layout
9+
title='Environments'
10+
description='Licenses, package ecosystems, programming languages, operating systems, vulnerability sources, and other environments supported by AboutCode tools. and data'
11+
>
12+
<main>
13+
<section className={styles.sectionContainer}>
14+
<div
15+
className={styles.sectionHeader}
16+
style={{ marginBottom: '15px', marginTop: '30px' }}
17+
>
18+
<h1>Environments</h1>
19+
</div>
20+
<div className={styles.sectionIntro}>
21+
<p>AboutCode tools support a large number of licenses,
22+
package ecosystems, programming languages, operating
23+
systems, binary and archive formats, and vulnerability
24+
data sources, all identified using{' '}
25+
<a href="https://packageurl.org">Package-URL (PURL)</a> or
26+
SPDX license expressions.</p>
27+
</div>
28+
<EcosystemGrid />
29+
</section>
30+
<div style={{ marginBottom: '50px' }}></div>
31+
</main>
32+
</Layout>
33+
);
34+
}

0 commit comments

Comments
 (0)