Skip to content

Commit f9596c7

Browse files
committed
Use specified year for collective attribution where applicable
1 parent f41a6fb commit f9596c7

File tree

4 files changed

+53
-37
lines changed

4 files changed

+53
-37
lines changed

src/content/examples/config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,21 @@ export const examplesCollection = defineCollection({
88
type: "content",
99
schema: ({ image }) =>
1010
z.object({
11+
1112
// Title of the example
1213
title: z.string(),
1314
oneLineDescription: z.string(),
15+
1416
// Aria label used for the live example code
1517
arialabel: z.string().optional(),
1618
featured: z.boolean().optional(),
1719
relatedReference: z.array(reference("reference")).optional(),
1820
featuredImage: image(),
1921
featuredImageAlt: z.string().optional().default(""),
22+
23+
// Start of collective attribution
24+
collectivelyAttributedSince: z.number().optional(),
25+
2026
// Optional list of remixes to add to license
2127
remix: z
2228
.array(

src/content/examples/en/01_Shapes_And_Color/00_Shape_Primitives/description.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ oneLineDescription: Draw 2D shapes.
66
relatedReference:
77
- en/p5/arc
88
- en/p5/ellipse
9+
910
remix:
1011
- attributionURL: https://github.com/dkessner
1112
attributionLabel: Darren Kessner

src/content/examples/en/15_Math_And_Physics/03_Smoke_Particle_System/description.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ featuredImageAlt: Rainbow colored smoke angled towards the right of the canvas,
44
title: Smoke Particles
55
oneLineDescription: Simulate smoke with a particle system.
66
featured: true
7+
8+
collectivelyAttributedSince: 2024
79
remix:
10+
- attributionURL: https://natureofcode.com/book/chapter-4-particle-systems/
11+
attributionLabel: Dan Shiffman's example
812
- attributionURL: https://github.com/dkessner
913
attributionLabel: Darren Kessner
1014
remixURL: https://github.com/processing/p5.js-example
1115
remixLabel: Revised in 2023
12-
- attributionURL: https://natureofcode.com/book/chapter-4-particle-systems/
13-
attributionLabel: Dan Shiffman's example
14-
1516
---
1617

1718

src/layouts/ExampleLayout.astro

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -66,45 +66,53 @@ const { Content } = await example.render();
6666
<div class="rendered-markdown">
6767
<p>
6868

69-
<a href={Astro.url.pathname}>{example.data.title}</a>:
70-
Edited and maintained by
71-
<a href="https://github.com/processing/p5.js?tab=readme-ov-file#contributors">p5.js Contributors</a>
72-
and the
73-
<a href="https://processingfoundation.org/people">Processing Foundation</a>.
74-
Licensed under{" "}
75-
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a>.
69+
<a href={Astro.url.pathname}>{example.data.title}</a>:
7670

71+
{example.data.remix?.map((item, i) => (
72+
<>
73+
{i > 0 && " "}
74+
{item.remixLabel && item.remixURL ? (
75+
<>
76+
<a href={item.remixURL}>{item.remixLabel}</a>
77+
{item.attributionLabel && (
78+
<>
79+
{" "}by{" "}
80+
{item.attributionURL ? (
81+
<a href={item.attributionURL}>{item.attributionLabel}</a>
82+
) : (
83+
item.attributionLabel
84+
)}.
85+
</>
86+
)}
87+
</>
88+
) : item.attributionLabel ? (
89+
<>
90+
Remixed from{" "}
91+
{item.attributionURL ? (
92+
<a href={item.attributionURL}>{item.attributionLabel}</a>
93+
) : (
94+
item.attributionLabel
95+
)}.
96+
</>
97+
) : null}
98+
</>
99+
))}
77100

78-
{example.data.remix?.map((item, i) => (
79-
<>
80-
{i > 0 && " "}
81-
{item.remixLabel && item.remixURL ? (
82-
<>
83-
<a href={item.remixURL}>{item.remixLabel}</a>
84-
{item.attributionLabel && (
101+
{example.data.collectivelyAttributedSince ? (
85102
<>
86-
{" "}by{" "}
87-
{item.attributionURL ? (
88-
<a href={item.attributionURL}>{item.attributionLabel}</a>
89-
) : (
90-
item.attributionLabel
91-
)}.
103+
From {example.data.collectivelyAttributedSince} onwards, edited and maintained by
92104
</>
93-
)}
94-
</>
95-
) : item.attributionLabel ? (
96-
<>
97-
Remixed from{" "}
98-
{item.attributionURL ? (
99-
<a href={item.attributionURL}>{item.attributionLabel}</a>
100105
) : (
101-
item.attributionLabel
102-
)}.
103-
</>
104-
) : null}
105-
</>
106-
))}
107-
106+
<>
107+
Edited and maintained by
108+
</>
109+
)}
110+
111+
<a href="https://github.com/processing/p5.js?tab=readme-ov-file#contributors">p5.js Contributors</a>
112+
and the
113+
<a href="https://processingfoundation.org/people">Processing Foundation</a>.
114+
Licensed under{" "}
115+
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a>.
108116

109117
</p>
110118
<img src="/images/by-nc-sa.svg" />

0 commit comments

Comments
 (0)