Skip to content

Commit 84192ae

Browse files
committed
Initial format for detailed example attribution
1 parent 8e571e8 commit 84192ae

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

src/content/examples/config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ 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+
revisedAttributionPrefixURL: z.string().optional().default(""),
25+
revisedAttributionName: z.string().optional().default(""),
26+
revisedAttributionURL: z.string().optional().default(""),
2027
}),
2128
});

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

+8-6
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ 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: Based on
8+
archiveAttributionName: Dan Shiffman's example
9+
archiveAttributionURL: https://natureofcode.com/book/chapter-4-particle-systems/
10+
revisedAttributionPrefix: Revised in 2023
11+
revisedAttributionPrefixURL: https://github.com/processing/p5.js-example
12+
revisedAttributionName: Darren Kessner
13+
revisedAttributionURL: https://github.com/dkessner
714
---
815

916

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-
15-
The code makes use of the
17+
This smoke particle system demo makes use of the
1618
<a href="https://p5js.org/reference/p5/p5.Vector">p5.Vector</a>
1719
class, including the
1820
<a href="https://p5js.org/reference/p5/createVector">createVector()</a>

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+
<a href={example.data.revisedAttributionPrefixURL}>{example.data.revisedAttributionPrefix}</a> by <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)