Skip to content

Commit 6bd4a8b

Browse files
docs/fix getFrontmatter custom data example snippet (#200)
1 parent 15d593a commit 6bd4a8b

4 files changed

Lines changed: 21 additions & 8 deletions

File tree

src/assets/aws.svg

Lines changed: 6 additions & 0 deletions
Loading

src/components/run-anywhere/platforms.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
[
22
{
3-
"name": "Vercel",
3+
"label": "Vercel",
44
"icon": "vercel",
55
"link": "/guides/hosting/vercel/"
66
},
77
{
8-
"name": "Netlify",
8+
"label": "Netlify",
99
"icon": "netlify",
1010
"link": "/guides/hosting/netlify/"
1111
},
1212
{
13-
"name": "NodeJS",
13+
"label": "NodeJS",
1414
"icon": "nodejs",
1515
"link": "/guides/hosting/#self-hosting"
1616
},
1717
{
18-
"name": "GitHub",
18+
"label": "AWS",
19+
"icon": "aws",
20+
"link": "/guides/hosting/aws/"
21+
},
22+
{
23+
"label": "GitHub",
1924
"icon": "github",
2025
"link": "/guides/hosting/github/"
2126
}

src/components/run-anywhere/run-anywhere.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import platforms from "./platforms.json" with { type: "json" };
2+
import awsLogo from "../../assets/aws.svg?type=raw";
23
import githubLogo from "../../assets/github.svg?type=raw";
34
import netlifyLogo from "../../assets/netlify.svg?type=raw";
45
import nodejsLogo from "../../assets/nodejs.svg?type=raw";
56
import vercelLogo from "../../assets/vercel.svg?type=raw";
67
import styles from "./run-anywhere.module.css";
78

89
const platformImageMapper = {
10+
aws: awsLogo,
911
github: githubLogo,
1012
netlify: netlifyLogo,
1113
nodejs: nodejsLogo,
@@ -22,15 +24,15 @@ export default class RunAnywhere extends HTMLElement {
2224
<div class="${styles.platformsContainer}">
2325
${platforms
2426
.map((platform) => {
25-
const { name, icon, link } = platform;
27+
const { label, icon, link } = platform;
2628
2729
return `
2830
<div class="${styles.platformBox}">
2931
<div class="${styles.iconBox}">
3032
${platformImageMapper[icon]}
3133
</div>
3234
33-
<a class="${styles.iconLink}" href="${link}">${name}</a>
35+
<a class="${styles.iconLink}" href="${link}">${label}</a>
3436
</div>
3537
`;
3638
})

src/pages/docs/pages/server-rendering.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,14 @@ Any Greenwood [supported frontmatter](/docs/resources/markdown/#frontmatter) can
207207
return {
208208
layout: "user",
209209
collection: "header",
210-
order: 1,
211210
title: `The ${route} page`,
212211
imports: [
213212
"/components/user.js",
214213
"/components/otherItem.js type=module"
215214
],
215+
// any custom data
216216
data: {
217-
/* ... */
217+
order: 1,
218218
},
219219
};
220220
}

0 commit comments

Comments
 (0)