aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2024-03-16 21:40:17 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2024-03-16 22:01:52 +0100
commit12be376975f55fe1ee118bca6d7ae5f699a881a4 (patch)
tree1e43086d3e11638fa99d1640e4585bc64647e991 /src/components
parentUse pathname:// for internal file links (diff)
downloadblog-12be376975f55fe1ee118bca6d7ae5f699a881a4.tar.gz
blog-12be376975f55fe1ee118bca6d7ae5f699a881a4.tar.zst
blog-12be376975f55fe1ee118bca6d7ae5f699a881a4.zip
Add license page
Diffstat (limited to 'src/components')
-rw-r--r--src/components/landing/sections/Hero.tsx2
-rw-r--r--src/components/landing/sections/Publications.module.css9
-rw-r--r--src/components/landing/sections/Publications.tsx74
-rw-r--r--src/components/landing/sections/Research.tsx2
-rw-r--r--src/components/landing/sections/Resume.module.css10
-rw-r--r--src/components/landing/sections/Resume.tsx21
-rw-r--r--src/components/licenses.module.css30
-rw-r--r--src/components/licenses.tsx92
8 files changed, 177 insertions, 63 deletions
diff --git a/src/components/landing/sections/Hero.tsx b/src/components/landing/sections/Hero.tsx
index 4974285..2773b9b 100644
--- a/src/components/landing/sections/Hero.tsx
+++ b/src/components/landing/sections/Hero.tsx
@@ -2,6 +2,8 @@
2 * SPDX-FileCopyrightText: 2023-2024 Kristóf Marussy 2 * SPDX-FileCopyrightText: 2023-2024 Kristóf Marussy
3 * 3 *
4 * SPDX-License-Identifier: MIT AND CC-BY-4.0 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';
diff --git a/src/components/landing/sections/Publications.module.css b/src/components/landing/sections/Publications.module.css
index c9a39ba..9ef368b 100644
--- a/src/components/landing/sections/Publications.module.css
+++ b/src/components/landing/sections/Publications.module.css
@@ -12,15 +12,6 @@
12 white-space: nowrap; 12 white-space: nowrap;
13} 13}
14 14
15.link--license {
16 --ifm-link-color: var(--ifm-color-secondary-contrast-foreground);
17 --ifm-link-hover-color: var(--ifm-link-color);
18}
19
20[data-theme='dark'] .link--license {
21 --ifm-link-color: var(--ifm-color-emphasis-500);
22}
23
24.link--lower { 15.link--lower {
25 text-transform: lowercase; 16 text-transform: lowercase;
26} 17}
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
diff --git a/src/components/landing/sections/Research.tsx b/src/components/landing/sections/Research.tsx
index ea6f076..a295419 100644
--- a/src/components/landing/sections/Research.tsx
+++ b/src/components/landing/sections/Research.tsx
@@ -2,6 +2,8 @@
2 * SPDX-FileCopyrightText: 2023 Kristóf Marussy 2 * SPDX-FileCopyrightText: 2023 Kristóf Marussy
3 * 3 *
4 * SPDX-License-Identifier: MIT AND CC-BY-4.0 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 clsx from 'clsx'; 9import clsx from 'clsx';
diff --git a/src/components/landing/sections/Resume.module.css b/src/components/landing/sections/Resume.module.css
index fb576a1..3293add 100644
--- a/src/components/landing/sections/Resume.module.css
+++ b/src/components/landing/sections/Resume.module.css
@@ -129,6 +129,16 @@
129 color: var(--ifm-color-emphasis-500); 129 color: var(--ifm-color-emphasis-500);
130} 130}
131 131
132.cv__muted-link {
133 white-space: nowrap;
134 --ifm-link-color: var(--ifm-color-secondary-contrast-foreground);
135 --ifm-link-hover-color: var(--ifm-link-color);
136}
137
138[data-theme='dark'] .cv__muted-link {
139 --ifm-link-color: var(--ifm-color-emphasis-500);
140}
141
132.cv__activities { 142.cv__activities {
133 margin: 1em 0; 143 margin: 1em 0;
134} 144}
diff --git a/src/components/landing/sections/Resume.tsx b/src/components/landing/sections/Resume.tsx
index 6e2bc69..bac2bde 100644
--- a/src/components/landing/sections/Resume.tsx
+++ b/src/components/landing/sections/Resume.tsx
@@ -2,6 +2,8 @@
2 * SPDX-FileCopyrightText: 2023-2024 Kristóf Marussy 2 * SPDX-FileCopyrightText: 2023-2024 Kristóf Marussy
3 * 3 *
4 * SPDX-License-Identifier: MIT AND CC-BY-4.0 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';
@@ -40,13 +42,18 @@ function Education() {
40 </Link> 42 </Link>
41 </p> 43 </p>
42 <p className={styles.cv__muted}> 44 <p className={styles.cv__muted}>
43 <Lock 45 <Link
44 weight="bold" 46 to="/license#restricted-content"
45 aria-hidden="true" 47 className={styles['cv__muted-link']}
46 className={styles['thesis-rights__icon']} 48 >
47 /> 49 <Lock
48 Some poritions may be exclusively licensed to their original 50 weight="bold"
49 publishers 51 aria-hidden="true"
52 className={styles['thesis-rights__icon']}
53 />
54 Some poritions may be exclusively licensed to their original
55 publishers
56 </Link>
50 </p> 57 </p>
51 <div className={styles['thesis-links']}> 58 <div className={styles['thesis-links']}>
52 <Link 59 <Link
diff --git a/src/components/licenses.module.css b/src/components/licenses.module.css
new file mode 100644
index 0000000..ac6c4cc
--- /dev/null
+++ b/src/components/licenses.module.css
@@ -0,0 +1,30 @@
1/*
2 * SPDX-FileCopyrightText: 2024 Kristóf Marussy
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7.link {
8 white-space: nowrap;
9 --ifm-link-color: var(--ifm-color-secondary-contrast-foreground);
10 --ifm-link-hover-color: var(--ifm-link-color);
11}
12
13[data-theme='dark'] .link {
14 --ifm-link-color: var(--ifm-color-emphasis-500);
15}
16
17.icon {
18 vertical-align: text-top;
19 width: 1em;
20 height: 1em;
21 margin-right: 0.125rem;
22}
23
24.text {
25 color: var(--ifm-color-secondary-contrast-foreground);
26}
27
28[data-theme='dark'] .text {
29 color: var(--ifm-color-emphasis-500);
30}
diff --git a/src/components/licenses.tsx b/src/components/licenses.tsx
new file mode 100644
index 0000000..85b0cb2
--- /dev/null
+++ b/src/components/licenses.tsx
@@ -0,0 +1,92 @@
1/*
2 * SPDX-FileCopyrightText: 2024 Kristóf Marussy
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7import Link, { type Props as LinkProps } from '@docusaurus/Link';
8import { Certificate, Lock } from '@phosphor-icons/react';
9
10import { CreativeCommonsIcon } from '@site/src/components/icons';
11
12import styles from './licenses.module.css';
13
14export type LicenseLinkProps = LinkProps & { label?: string };
15
16export function LicenseLink({ children, label, ...props }: LicenseLinkProps) {
17 return (
18 <Link className={styles.link} {...props}>
19 <Certificate weight="bold" aria-hidden="true" className={styles.icon} />
20 <span className="sr-only">{label ?? 'License'}: </span>
21 {children}
22 </Link>
23 );
24}
25
26export function MITLicenseLink() {
27 return <LicenseLink to="https://spdx.org/licenses/MIT.html">MIT</LicenseLink>;
28}
29
30export function CCLicenseLink({ children, label, ...props }: LicenseLinkProps) {
31 return (
32 <Link className={styles.link} {...props}>
33 <CreativeCommonsIcon className={styles.icon} hidden />
34 <span className="sr-only">{label ?? 'Creative Commons license'}: </span>
35 {children}
36 </Link>
37 );
38}
39
40export function CCBYLicenseLink() {
41 return (
42 <CCLicenseLink to="https://creativecommons.org/licenses/by/4.0/">
43 CC-BY-4.0
44 </CCLicenseLink>
45 );
46}
47
48export function ClosedAccessLink({
49 children,
50 label,
51 ...props
52}: LicenseLinkProps) {
53 return (
54 <Link className={styles.link} {...props}>
55 <Lock weight="bold" aria-hidden="true" className={styles.icon} />
56 <span className="sr-only">{label ?? 'Closed access'}: </span>
57 {children}
58 </Link>
59 );
60}
61
62export type SpanProps = React.DetailedHTMLProps<
63 React.HTMLAttributes<HTMLSpanElement>,
64 HTMLSpanElement
65>;
66
67export function LicenseText({ children, ...props }: SpanProps) {
68 return (
69 <span className={styles.text} {...props}>
70 <Certificate weight="bold" aria-hidden="true" className={styles.icon} />
71 {children}
72 </span>
73 );
74}
75
76export function CCLicenseText({ children, ...props }: SpanProps) {
77 return (
78 <span className={styles.text} {...props}>
79 <CreativeCommonsIcon className={styles.icon} hidden />
80 {children}
81 </span>
82 );
83}
84
85export function ClosedAccessText({ children, ...props }: SpanProps) {
86 return (
87 <span className={styles.text} {...props}>
88 <Lock weight="bold" aria-hidden="true" className={styles.icon} />
89 {children}
90 </span>
91 );
92}