@@ -43,14 +43,17 @@ const relatedReferences =
43
43
44
44
const { Content } = await example .render ();
45
45
46
- const collectivelyAttributedSince = example .data .remix ?.reduce ((acc , item ) => {
47
- if (typeof item === " string" ) return acc ;
48
- if (item .collectivelyAttributedSince ) {
49
- return item .collectivelyAttributedSince ;
50
- }
51
- return acc ;
52
- }, null );
53
-
46
+ // Extract the collective attribution year. If multiple provided, uses last shown.
47
+ const collectivelyAttributedSince = example .data .remix ?.reduce (
48
+ (acc : number | null , item ) => {
49
+ if (typeof item === " string" ) return acc ;
50
+ if (item .collectivelyAttributedSince ) {
51
+ return item .collectivelyAttributedSince ;
52
+ }
53
+ return acc ;
54
+ },
55
+ null
56
+ );
54
57
55
58
---
56
59
@@ -83,6 +86,9 @@ const collectivelyAttributedSince = example.data.remix?.reduce((acc, item) => {
83
86
84
87
const parts = [];
85
88
89
+ // Each remix entry requires either attribution, or a codeURL; these have no defaults
90
+ // If a remix entry contains a collective attribution starting year, it is ignored here
91
+
86
92
if (! item .collectivelyAttributedSince && (item .attribution || item .codeURL )) {
87
93
parts .push (<>{ item .description } </>);
88
94
@@ -93,7 +99,7 @@ const collectivelyAttributedSince = example.data.remix?.reduce((acc, item) => {
93
99
{ item .attribution .map ((a , j ) => (
94
100
<>
95
101
{ a .URL ? <a href = { a .URL } >{ a .name } </a > : a .name }
96
- { j < item .attribution .length - 1 ? " , " : ! item .codeURL ? " ." : " " }
102
+ { j < ( item .attribution ? .length ?? 0 ) - 1 ? " , " : ! item .codeURL ? " ." : " " }
97
103
</>
98
104
))}
99
105
</>
@@ -109,7 +115,7 @@ const collectivelyAttributedSince = example.data.remix?.reduce((acc, item) => {
109
115
}
110
116
}
111
117
112
- return <span key = { i } >{ i > 0 && " " } { parts } </span >;
118
+ return <span >{ i > 0 && " " } { parts } </span >;
113
119
})}
114
120
115
121
{ collectivelyAttributedSince ? (
0 commit comments