Skip to content

Commit 9353c52

Browse files
committed
Initial format for detailed example attribution
1 parent 8e571e8 commit 9353c52

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

src/content/examples/config.ts

+6
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,11 @@ export const examplesCollection = defineCollection({
1717
relatedReference: z.array(reference("reference")).optional(),
1818
featuredImage: image(),
1919
featuredImageAlt: z.string().optional().default(""),
20+
archiveAttributionPrefix: z.string().optional().default(""),
21+
archiveAttributionName: z.string().optional().default(""),
22+
archiveAttributionURL: z.string().optional().default(""),
23+
revisedAttributionPrefix: z.string().optional().default(""),
24+
revisedAttributionName: z.string().optional().default(""),
25+
revisedAttributionURL: z.string().optional().default(""),
2026
}),
2127
});

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

+6-5
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+
archiveAttributionPrefix: Smoke particle system demo, based on
8+
archiveAttributionName: Dan Shiffman's example
9+
archiveAttributionURL: https://natureofcode.com/book/chapter-4-particle-systems/
10+
revisedAttributionPrefix: Revised in 2023 by
11+
revisedAttributionName: Darren Kessner
12+
revisedAttributionURL: https://github.com/dkessner
713
---
814

915

10-
Smoke particle system demo, based on
11-
Dan Shiffman's original
12-
<a href="https://natureofcode.com/book/chapter-4-particle-systems/">example</a>
13-
for Processing.
14-
1516
The code makes use of the
1617
<a href="https://p5js.org/reference/p5/p5.Vector">p5.Vector</a>
1718
class, including the

src/layouts/ExampleLayout.astro

+10-3
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,21 @@ const { Content } = await example.render();
6363
<div class="rendered-markdown">
6464
<Content />
6565
</div>
66-
<EditableSketch code={code} />
67-
<p>{example.data.arialabel}</p>
6866
<div class="rendered-markdown">
6967
<p>
70-
<a href={Astro.url.pathname}>{example.data.title}</a> by <a href="https://p5js.org/people">p5.js Contributors</a> and the <a href="https://processingfoundation.org/people">Processing Foundation</a> is licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a>.
68+
69+
<a href={Astro.url.pathname}>{example.data.title}</a>:
70+
{example.data.archiveAttributionPrefix} <a href={example.data.archiveAttributionURL}>{example.data.archiveAttributionName}</a>.
71+
{example.data.revisedAttributionPrefix} <a href={example.data.revisedAttributionURL}>{example.data.revisedAttributionName}</a>.
72+
From 2023 onwards, edited and maintained by <a href="https://github.com/processing/p5.js?tab=readme-ov-file#contributors">p5.js Contributors</a> and the <a href="https://processingfoundation.org/people">Processing Foundation</a>. Licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a>.
73+
7174
</p>
7275
<img src="/images/by-nc-sa.svg" />
7376
</div>
77+
78+
<EditableSketch code={code} />
79+
<p>{example.data.arialabel}</p>
80+
7481
</div>
7582
<div class="grid gap-y-4xl lg:gap-y-mb-3xl mt-2xl">
7683
{

0 commit comments

Comments
 (0)