|
6 | 6 | // Shared constants for the article template and helper functions |
7 | 7 | // -------------------------------------------------------------- |
8 | 8 |
|
9 | | -#let ccPrimaryYellow = "#f8d7b0" |
10 | | -#let ccSecondaryBrown = "#392518" |
11 | | -#let ccAccentBlue = "#7bd4ff" |
12 | | -#let ccLighterBlue = "#cceeff" |
13 | | -#let ccAccentGreen = "#90ee90" |
14 | | -#let ccLightGrey = "#666666" |
15 | | -#let ccDividerGrey = "#dddddd" |
16 | | -#let ccCodeBackground = "#f8f9fa" |
17 | | -#let blockRadiusValue = 2pt |
| 9 | +#let cc-primary-yellow = "#f8d7b0" |
| 10 | +#let cc-secondary-brown = "#392518" |
| 11 | +#let cc-accent-blue = "#7bd4ff" |
| 12 | +#let cc-lighter-blue = "#cceeff" |
| 13 | +#let cc-accent-green = "#90ee90" |
| 14 | +#let cc-light-grey = "#666666" |
| 15 | +#let cc-divider-grey = "#dddddd" |
| 16 | +#let cc-code-background = "#f8f9fa" |
| 17 | +#let block-radius-value = 2pt |
18 | 18 |
|
19 | 19 |
|
20 | 20 | // ------------------------------------------------ |
|
123 | 123 | align: (left, right), |
124 | 124 | gutter: 1em, |
125 | 125 | [ |
126 | | - #text(size: 0.8em, weight: "semibold", fill: rgb(ccSecondaryBrown))[ |
| 126 | + #text(size: 0.8em, weight: "semibold", fill: rgb(cc-secondary-brown))[ |
127 | 127 | #publication |
128 | 128 | ] |
129 | 129 | ], |
130 | 130 | [ |
131 | | - #text(size: 0.8em, style: "italic", fill: rgb(ccSecondaryBrown))[ |
| 131 | + #text(size: 0.8em, style: "italic", fill: rgb(cc-secondary-brown))[ |
132 | 132 | #short-title |
133 | 133 | ] |
134 | 134 | ], |
135 | 135 | ) |
136 | | - line(length: 100%, stroke: 0.5pt + rgb(ccDividerGrey)) |
| 136 | + line(length: 100%, stroke: 0.5pt + rgb(cc-divider-grey)) |
137 | 137 | } |
138 | 138 |
|
139 | 139 | // The first page header is an article metadata bar |
140 | 140 | let article-metadata() = { |
141 | 141 | rect( |
142 | 142 | width: 100%, |
143 | | - fill: rgb(ccPrimaryYellow), |
144 | | - stroke: rgb(ccSecondaryBrown), |
| 143 | + fill: rgb(cc-primary-yellow), |
| 144 | + stroke: rgb(cc-secondary-brown), |
145 | 145 | inset: .6em, |
146 | | - radius: blockRadiusValue |
| 146 | + radius: block-radius-value |
147 | 147 | )[ |
148 | 148 | #grid( |
149 | 149 | columns: (1fr, auto), |
150 | 150 | gutter: 1em, |
151 | 151 | [ |
152 | | - #text(size: 0.9em, fill: rgb(ccSecondaryBrown))[ |
| 152 | + #text(size: 0.9em, fill: rgb(cc-secondary-brown))[ |
153 | 153 | *Category:* Article |
154 | 154 | #if reading-time != none [ • *Reading time:* #reading-time ] |
155 | 155 | ] |
156 | 156 | ], |
157 | 157 | [ |
158 | | - #text(size: 0.9em, fill: rgb(ccSecondaryBrown))[ |
| 158 | + #text(size: 0.9em, fill: rgb(cc-secondary-brown))[ |
159 | 159 | #date.display("[day] [month repr:long] [year]") |
160 | 160 | ] |
161 | 161 | ] |
|
186 | 186 | "" |
187 | 187 | } |
188 | 188 |
|
189 | | - line(length: 100%, stroke: 0.5pt + rgb(ccDividerGrey)) |
| 189 | + line(length: 100%, stroke: 0.5pt + rgb(cc-divider-grey)) |
190 | 190 | grid( |
191 | 191 | columns: (1fr, auto, 1fr), |
192 | 192 | align: (left, center, right), |
193 | 193 | gutter: 1em, |
194 | 194 | [ |
195 | | - #text(size: 0.8em, fill: rgb(ccLightGrey))[ |
| 195 | + #text(size: 0.8em, fill: rgb(cc-light-grey))[ |
196 | 196 | #author-text |
197 | 197 | ] |
198 | 198 | ], |
199 | 199 | [ |
200 | 200 | #context counter(page).get().first() |
201 | 201 | ], |
202 | 202 | [ |
203 | | - #text(size: 0.7em, fill: rgb(ccLightGrey), style: "italic")[ |
| 203 | + #text(size: 0.7em, fill: rgb(cc-light-grey), style: "italic")[ |
204 | 204 | #if watermark != none [ |
205 | 205 | #watermark |
206 | 206 | ] else [ |
|
287 | 287 | #block(text( |
288 | 288 | weight: "medium", |
289 | 289 | size: 1.4em, |
290 | | - fill: rgb(ccLightGrey), |
| 290 | + fill: rgb(cc-light-grey), |
291 | 291 | subtitle |
292 | 292 | )) |
293 | 293 | ] |
|
315 | 315 | if abstract != none { |
316 | 316 | rect( |
317 | 317 | width: 100%, |
318 | | - fill: rgb(ccLighterBlue), |
319 | | - stroke: (left: 3pt + rgb(ccAccentBlue)), |
| 318 | + fill: rgb(cc-lighter-blue), |
| 319 | + stroke: (left: 3pt + rgb(cc-accent-blue)), |
320 | 320 | inset: 1.2em, |
321 | | - radius: blockRadiusValue, |
| 321 | + radius: block-radius-value, |
322 | 322 | )[ |
323 | 323 | #set par(justify: true) |
324 | 324 | #heading(outlined: false, numbering: none, text(0.85em)[Abstract]) |
325 | 325 | #abstract |
326 | 326 | // Keywords (if provided) |
327 | 327 | #if keywords.len() > 0 { |
328 | 328 | v(1em) |
329 | | - text(size: 10pt, fill: rgb(ccLightGrey))[ |
| 329 | + text(size: 10pt, fill: rgb(cc-light-grey))[ |
330 | 330 | *Keywords:* #keywords.join(", ") |
331 | 331 | ] |
332 | 332 | } |
333 | 333 |
|
334 | 334 | // The website URL |
335 | | - #text(size: 0.9em, fill: rgb(ccLightGrey))[ |
| 335 | + #text(size: 0.9em, fill: rgb(cc-light-grey))[ |
336 | 336 | *Latest Version:* #link(website-url)[#website-url] |
337 | 337 | ] |
338 | 338 | ] |
|
349 | 349 |
|
350 | 350 | // Bibliography section if provided |
351 | 351 | if bibliography != none { |
352 | | - line(length: 100%, stroke: 0.5pt + rgb(ccDividerGrey)) |
| 352 | + line(length: 100%, stroke: 0.5pt + rgb(cc-divider-grey)) |
353 | 353 | bibliography |
354 | 354 | } |
355 | 355 | } |
|
369 | 369 | /// The icon to display in the callout box. Optional. |
370 | 370 | icon: emoji.notepad, |
371 | 371 | /// The color of the callout box. Optional, defaults to Coders' Compass accent blue. |
372 | | - color: rgb(ccAccentBlue), |
| 372 | + color: rgb(cc-accent-blue), |
373 | 373 | /// The body content of the callout box. This is required. |
374 | 374 | body |
375 | 375 | ) = { |
|
378 | 378 | fill: color.lighten(95%), |
379 | 379 | stroke: (left: 3pt + color), |
380 | 380 | inset: 1em, |
381 | | - radius: blockRadiusValue, |
| 381 | + radius: block-radius-value, |
382 | 382 | )[ |
383 | 383 | #text( |
384 | 384 | weight: "semibold", |
|
402 | 402 | return quote(block: block, attribution: attribution, ..body) |
403 | 403 | } |
404 | 404 |
|
405 | | - let colour = rgb(ccAccentBlue) |
| 405 | + let colour = rgb(cc-accent-blue) |
406 | 406 | let content = body.pos().join() |
407 | 407 |
|
408 | 408 | return rect( |
409 | 409 | width: 100%, |
410 | 410 | fill: colour.lighten(95%), |
411 | 411 | stroke: (left: 3pt + colour), |
412 | 412 | inset: 1em, |
413 | | - radius: blockRadiusValue, |
| 413 | + radius: block-radius-value, |
414 | 414 | )[ |
415 | 415 | #content |
416 | 416 | ] |
|
0 commit comments