aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/landing/sections/Publications.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/landing/sections/Publications.tsx')
-rw-r--r--src/components/landing/sections/Publications.tsx74
1 files changed, 27 insertions, 47 deletions
diff --git a/src/components/landing/sections/Publications.tsx b/src/components/landing/sections/Publications.tsx
index 90c058e..068ec49 100644
--- a/src/components/landing/sections/Publications.tsx
+++ b/src/components/landing/sections/Publications.tsx
@@ -1,22 +1,16 @@
1/* 1/*
2 * SPDX-FileCopyrightText: 2023-2024 Kristóf Marussy 2 * SPDX-FileCopyrightText: 2023-2024 Kristóf Marussy
3 * 3 *
4 * SPDX-License-Identifier: MIT 4 * SPDX-License-Identifier: MIT AND CC-BY-4.0
5 *
6 * Code in this file is MIT licensed, while content is CC-BY-4.0 licensed.
5 */ 7 */
6 8
7import Link from '@docusaurus/Link'; 9import Link from '@docusaurus/Link';
8import { 10import { ArrowSquareOut, File, Package, Play } from '@phosphor-icons/react';
9 ArrowSquareOut,
10 Certificate,
11 File,
12 Lock,
13 Package,
14 Play,
15} from '@phosphor-icons/react';
16import clsx from 'clsx'; 11import clsx from 'clsx';
17 12
18import { 13import {
19 CreativeCommonsIcon,
20 DBLPIcon, 14 DBLPIcon,
21 GoogleScholarIcon, 15 GoogleScholarIcon,
22 MTMTIcon, 16 MTMTIcon,
@@ -26,6 +20,11 @@ import {
26import Section from '@site/src/components/landing/Section'; 20import Section from '@site/src/components/landing/Section';
27import Subtitle from '@site/src/components/landing/Subtitle'; 21import Subtitle from '@site/src/components/landing/Subtitle';
28import authorizedLinks from '@site/src/components/landing/sections/authorizedLinks'; 22import authorizedLinks from '@site/src/components/landing/sections/authorizedLinks';
23import {
24 CCLicenseLink,
25 ClosedAccessLink,
26 LicenseLink,
27} from '@site/src/components/licenses';
29 28
30import styles from './Publications.module.css'; 29import styles from './Publications.module.css';
31 30
@@ -101,59 +100,40 @@ function ClosedAccess({
101 url: string; 100 url: string;
102 authorizedURL?: string | undefined; 101 authorizedURL?: string | undefined;
103}) { 102}) {
104 const label = (
105 <>
106 <Lock weight="bold" aria-hidden="true" className={styles.link__icon} />
107 <span className="sr-only">Closed Access: </span>
108 {publisher}
109 </>
110 );
111 if (authorizedURL !== undefined) {
112 // Must allow referrer for the ACM Author-Izer to work.
113 return (
114 <Link
115 to={authorizedURL}
116 rel="nofollow noopener"
117 referrerPolicy="no-referrer-when-downgrade"
118 className={clsx(styles.link, styles['link--license'])}
119 >
120 {label}
121 </Link>
122 );
123 }
124 return ( 103 return (
125 <Link 104 <ClosedAccessLink
126 to={url} 105 to={authorizedURL ?? url}
127 rel="nofollow noopener noreferrer" 106 rel="nofollow noopener noreferrer"
128 className={clsx(styles.link, styles['link--license'])} 107 {...(authorizedURL === undefined
108 ? {
109 rel: 'nofollow noopener noreferrer',
110 }
111 : {
112 // Must allow referrer for the ACM Author-Izer to work.
113 rel: 'nofollow noopener',
114 referrerPolicy: 'no-referrer-when-downgrade',
115 })}
116 label="Closed Access"
129 > 117 >
130 {label} 118 {publisher}
131 </Link> 119 </ClosedAccessLink>
132 ); 120 );
133} 121}
134 122
135function OpenAccess({ license }: { license: string }) { 123function OpenAccess({ license }: { license: string }) {
136 const url = `https://creativecommons.org/licenses/${license}/4.0/`; 124 const url = `https://creativecommons.org/licenses/${license}/4.0/`;
137 return ( 125 return (
138 <Link to={url} className={clsx(styles.link, styles['link--license'])}> 126 <CCLicenseLink to={url} label="Open Access">
139 <CreativeCommonsIcon className={styles.link__icon} hidden />
140 <span className="sr-only">Open Access: </span>
141 CC-{license.toUpperCase()}-4.0 127 CC-{license.toUpperCase()}-4.0
142 </Link> 128 </CCLicenseLink>
143 ); 129 );
144} 130}
145 131
146function ArtifactLicense({ license, url }: { license: string; url: string }) { 132function ArtifactLicense({ license, url }: { license: string; url: string }) {
147 return ( 133 return (
148 <Link to={url} className={clsx(styles.link, styles['link--license'])}> 134 <LicenseLink to={url} label="Artifact license">
149 <Certificate
150 weight="bold"
151 aria-hidden="true"
152 className={styles.link__icon}
153 />
154 <span className="sr-only">Artifact license: </span>
155 {license} 135 {license}
156 </Link> 136 </LicenseLink>
157 ); 137 );
158} 138}
159 139