Skip to content

Commit d8951af

Browse files
committed
Switch to file names
1 parent bc216f1 commit d8951af

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

deck/examples.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export const getExamples = async () => {
2929
examples[key.toLocaleLowerCase()] = {
3030
name: key,
3131
path: html.replace("index.html", ""),
32+
codeFileName: code.split("/").pop(),
3233
code: await fetch(code).then((res) => res.text()),
34+
htmlFileName: html.split("/").pop(),
3335
html: await fetch(html)
3436
.then((res) => res.text())
3537
.then((html) => {

index.html

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,25 +118,26 @@
118118

119119
// Examples presentation.
120120
Object.keys(examples).forEach((key) => {
121-
examples[key].slides = html`
121+
const ex = examples[key];
122+
ex.slides = html`
122123
<${Fragment} key=${key}>
123124
<${Slide}>
124125
<${Heading} fontSize="h3">
125-
${examples[key].name}
126-
<span style=${{ color: theme.colors.primary }}> - Code </span>
127-
<${IconLink} href=${examples[key].path} name="link" color=${theme.colors.primary} />
126+
${ex.name} -
127+
${" "}<code style=${{ color: theme.colors.primary }}>${ex.codeFileName}</code>
128+
${" "}<${IconLink} href=${ex.path} name="link" color=${theme.colors.quaternary} />
128129
</${Heading}>
129130
<${CodePane} language="${key === "typescript" ? "typescript" : "javascript"}">
130-
${examples[key].code}
131+
${ex.code}
131132
</${CodePane}>
132133
</${Slide}>
133-
${examples[key].html.map(
134+
${ex.html.map(
134135
(block, index, items) => html`
135136
<${Slide} key=${index}>
136137
<${Heading} fontSize="h3">
137-
${examples[key].name}
138-
<span style=${{ color: theme.colors.primary }}> - HTML${items.length > 1 ? ` (${index + 1})` : ""} </span>
139-
<${IconLink} href=${examples[key].path} name="link" color=${theme.colors.primary} />
138+
${ex.name} ${items.length > 1 ? ` (${index + 1})` : ""} -
139+
${" "}<code style=${{ color: theme.colors.primary }}>${ex.htmlFileName}</code>
140+
${" "}<${IconLink} href=${ex.path} name="link" color=${theme.colors.secondary} />
140141
</${Heading}>
141142
<${CodePane} language="html">${block}</${CodePane}>
142143
</${Slide}>
@@ -193,7 +194,7 @@
193194
</${Text}>
194195
</${FlexBox}>
195196
</${Slide}>
196-
<${MarkdownSlideSet}>
197+
<${MarkdownSlideSet}>
197198
${`
198199
---
199200
# Let's talk
@@ -223,6 +224,13 @@
223224
</${ListItem}>
224225
</${UnorderedList}>
225226
</${Slide}>
227+
<${MarkdownSlideSet}>
228+
${`
229+
--- { "layout": "center" }
230+
# And it looked like this...
231+
232+
`}
233+
</${MarkdownSlideSet}>
226234
${examples.legacy.slides}
227235
<${MarkdownSlideSet}>
228236
${`

0 commit comments

Comments
 (0)