Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Astro bits
---
import { Markdown } from 'astro/components';
import BaseLayout from "../../layouts/BaseLayout.astro";
import TwitterLink from "../../components/TwitterLink.astro";
import peopleJson from "../../data/people.json"
export async function getStaticPaths() {
const currentPeople = peopleJson.filter((person) => person['current identities'].length)
const paths = currentPeople.map((personData) => {
const result = {
params: { person: personData.id },
props: { personData }
};
return result
})
return paths
}
const { person } = Astro.request.params
const { personData } = Astro.props
---
<BaseLayout title={`${personData.first} ${personData.last}`}>
<div itemscope itemtype="https://schema.org/Person">
<h1 itemprop="name">{`${personData.first} ${personData.last}`}</h1>
<h2 itemprop="jobTitle">{personData['current identities'][0].title}</h2>
<img itemprop="image" src={personData.headshot[0].url} alt={`${personData.first} ${personData.last}`} width=320 />
<div class="person-meta">
{personData.phone ? <span itemprop="telephone">{personData.phone}</span> : ""}
{personData.email ? <a href={`mailto:${personData.email}`} itemprop="email">
{personData.email}</a> : "" }
{personData.website ? <a href={personData.website}>{personData.website}</a>: ""}
{personData.twitter ? <TwitterLink twitterHandle={personData.twitter} /> : ""}
</div>
<div class="bio">
<Markdown content={personData.bio} />
</div>
</div>
</BaseLayout>
---
import HeaderLayout from "./HeaderLayout.astro"
import FooterLayout from "./FooterLayout.astro"
const {title} = Astro.props;
---
<!doctype html>
<html lang="us-en">
<head>
<title>{title} | MITH</title>
<link rel="stylesheet" href="/styles/global.css" />
</head>
<body>
<HeaderLayout />
<main>
<slot />
</main>
<FooterLayout />
<script src="https://umd-header.umd.edu/build/bundle.js?search=0&search_domain=&events=0&news=0&schools=0&admissions=0&support=0&support_url=&wrapper=1100&sticky=1"></script>
</body>
</html>
sandbox@sse-sandbox-6d10e:/sandbox$ ./node_modules/astro/astro.js build --verbose
[config] Set "buildOptions.site" to generate correct canonical URLs and sitemap
[23:34:26] [snowpack] loaded plugin: /sandbox/node_modules/astro/snowpack-plugin-jsx.cjs
[23:34:26] [snowpack] loaded plugin: /sandbox/node_modules/astro/snowpack-plugin.cjs
[23:34:26] [snowpack] loaded plugin: /sandbox/node_modules/@snowpack/plugin-sass/plugin.js
[23:34:26] [snowpack] loaded plugin: /sandbox/node_modules/@snowpack/plugin-postcss/plugin.js
[23:34:26] [snowpack] Install directory ".meta" file is up-to-date. Welcome back!
[23:34:26] [snowpack] Scanning public/styles/global.css for imports as CSS
[23:34:26] [snowpack] Scanning node_modules/astro/dist/frontend/500.astro for imports as Astro
[23:34:26] [snowpack] Scanning node_modules/astro/dist/frontend/__astro_config.js for imports as JS
[23:34:26] [snowpack] Scanning node_modules/astro/dist/frontend/hydrate/idle.js for imports as JS
[23:34:26] [snowpack] Scanning node_modules/astro/dist/frontend/hydrate/load.js for imports as JS
[23:34:26] [snowpack] Scanning node_modules/astro/dist/frontend/hydrate/media.js for importsas JS
[23:34:26] [snowpack] Scanning node_modules/astro/dist/frontend/hydrate/only.js for imports as JS
[23:34:26] [snowpack] Scanning node_modules/astro/dist/frontend/hydrate/visible.js for imports as JS
[23:34:26] [snowpack] Scanning src/components/PersonPreview.astro for imports as Astro
[23:34:26] [snowpack] Scanning src/components/TwitterLink.astro for imports as Astro
[23:34:26] [snowpack] Scanning src/layouts/BaseLayout.astro for imports as Astro
[23:34:26] [snowpack] Scanning src/layouts/FooterLayout.astro for imports as Astro
[23:34:26] [snowpack] Scanning src/layouts/SiteMenuInnerLayout.astro for imports as Astro
[23:34:26] [snowpack] Scanning src/pages/index.astro for imports as Astro
[23:34:26] [snowpack] Scanning src/pages/people/[person].astro for imports as Astro
[23:34:26] [snowpack] Scanning src/pages/people/index.astro for imports as Astro
[23:34:27] [snowpack] Ready!
[23:34:27] [snowpack] Mounting directory: '/sandbox/public' as URL '/'
[23:34:27] [snowpack] Mounting directory: '/sandbox/node_modules/astro/dist/frontend' as URL'/_astro_frontend'
[23:34:27] [snowpack] Mounting directory: '/sandbox/src' as URL '/_astro/src'
[23:34:27] [snowpack] Using in-memory cache: [object Object]
[build] ! building pages...
[23:34:27] [snowpack-astro] load() starting… [src/pages/people/[person].astro]
[23:34:27] [snowpack-astro] ✔ load() success [src/pages/people/[person].astro]
[23:34:27] [snowpack-astro] transform() starting… [src/pages/people/[person].js]
[23:34:27] [snowpack-astro] ✔ transform() success [src/pages/people/[person].js]
[23:34:27] [@snowpack/postcss-transform] transform() starting… [src/pages/people/[person].js]
[23:34:27] [@snowpack/postcss-transform] ✔ transform() success [src/pages/people/[person].js]
[23:34:27] [snowpack] Scanning src/pages/people/[person].astro for imports as JS
[23:34:27] [snowpack-astro] load() starting… [src/components/TwitterLink.astro]
[23:34:27] [snowpack-astro] load() starting… [src/layouts/BaseLayout.astro]
[23:34:27] [snowpack-astro] ✔ load() success [src/components/TwitterLink.astro]
[23:34:27] [snowpack-astro] transform() starting… [src/components/TwitterLink.js]
[23:34:27] [snowpack-astro] ✔ transform() success [src/components/TwitterLink.js]
[23:34:27] [@snowpack/postcss-transform] transform() starting… [src/components/TwitterLink.js]
[23:34:27] [@snowpack/postcss-transform] ✔ transform() success [src/components/TwitterLink.js]
[23:34:27] [snowpack] Scanning src/components/TwitterLink.astro for imports as JS
[23:34:27] [snowpack-astro] ✔ load() success [src/layouts/BaseLayout.astro]
[23:34:27] [snowpack-astro] transform() starting… [src/layouts/BaseLayout.js]
[23:34:27] [snowpack-astro] ✔ transform() success [src/layouts/BaseLayout.js]
[23:34:27] [@snowpack/postcss-transform] transform() starting… [src/layouts/BaseLayout.js]
[23:34:27] [@snowpack/postcss-transform] ✔ transform() success [src/layouts/BaseLayout.js]
[23:34:27] [snowpack] Scanning src/layouts/BaseLayout.astro for imports as JS
[23:34:27] [snowpack-astro] transform() starting… [src/data/people-full.json]
[23:34:27] [snowpack-astro] ✔ transform() success [src/data/people-full.json]
[23:34:27] [@snowpack/postcss-transform] transform() starting… [src/data/people-full.json]
[23:34:27] [@snowpack/postcss-transform] ✔ transform() success [src/data/people-full.json]
[23:34:27] [snowpack-astro] load() starting… [src/layouts/FooterLayout.astro]
[23:34:28] [snowpack-astro] ✔ load() success [src/layouts/FooterLayout.astro]
[23:34:28] [snowpack-astro] transform() starting… [src/layouts/FooterLayout.js]
[23:34:28] [snowpack-astro] ✔ transform() success [src/layouts/FooterLayout.js]
[23:34:28] [snowpack-astro] transform() starting… [src/layouts/FooterLayout.css]
[23:34:28] [snowpack-astro] ✔ transform() success [src/layouts/FooterLayout.css]
[23:34:28] [@snowpack/postcss-transform] transform() starting… [src/layouts/FooterLayout.js]
[23:34:28] [@snowpack/postcss-transform] ✔ transform() success [src/layouts/FooterLayout.js]
[23:34:28] [@snowpack/postcss-transform] transform() starting… [src/layouts/FooterLayout.css]
[23:34:28] [@snowpack/postcss-transform] ✔ transform() success [src/layouts/FooterLayout.css]
[23:34:28] [snowpack] Scanning src/layouts/FooterLayout.astro for imports as JS
[23:34:28] [snowpack] Scanning src/layouts/FooterLayout.astro for imports as CSS
[23:34:28] [snowpack-astro] load() starting… [src/layouts/SiteMenuInnerLayout.astro]
[23:34:28] [snowpack-astro] ✔ load() success [src/layouts/SiteMenuInnerLayout.astro]
[23:34:28] [snowpack-astro] transform() starting… [src/layouts/SiteMenuInnerLayout.js]
[23:34:28] [snowpack-astro] ✔ transform() success [src/layouts/SiteMenuInnerLayout.js]
[23:34:28] [@snowpack/postcss-transform] transform() starting… [src/layouts/SiteMenuInnerLayout.js]
[23:34:28] [@snowpack/postcss-transform] ✔ transform() success [src/layouts/SiteMenuInnerLayout.js]
[23:34:28] [snowpack] Scanning src/layouts/SiteMenuInnerLayout.astro for imports as JS
[23:34:29] [snowpack-astro] transform() starting… [node_modules/astro/dist/frontend/__astro_config.js]
[23:34:29] [snowpack-astro] ✔ transform() success [node_modules/astro/dist/frontend/__astro_config.js]
[23:34:29] [@snowpack/postcss-transform] transform() starting… [node_modules/astro/dist/frontend/__astro_config.js]
[23:34:29] [@snowpack/postcss-transform] ✔ transform() success [node_modules/astro/dist/frontend/__astro_config.js]
[23:34:29] [snowpack] Scanning node_modules/astro/dist/frontend/__astro_config.js for imports as JS
[23:34:29] [snowpack-astro] load() starting… [src/pages/index.astro]
[23:34:29] [snowpack-astro] load() starting… [src/pages/people/index.astro]
[23:34:29] [snowpack-astro] ✔ load() success [src/pages/index.astro]
[23:34:29] [snowpack-astro] transform() starting… [src/pages/index.js]
[23:34:29] [snowpack-astro] ✔ transform() success [src/pages/index.js]
[23:34:29] [@snowpack/postcss-transform] transform() starting… [src/pages/index.js]
[23:34:29] [@snowpack/postcss-transform] ✔ transform() success [src/pages/index.js]
[23:34:29] [snowpack] Scanning src/pages/index.astro for imports as JS
[23:34:29] [snowpack-astro] ✔ load() success [src/pages/people/index.astro]
[23:34:29] [snowpack-astro] transform() starting… [src/pages/people/index.js]
[23:34:29] [snowpack-astro] ✔ transform() success [src/pages/people/index.js]
[23:34:29] [@snowpack/postcss-transform] transform() starting… [src/pages/people/index.js]
[23:34:29] [@snowpack/postcss-transform] ✔ transform() success [src/pages/people/index.js]
[23:34:29] [snowpack] Scanning src/pages/people/index.astro for imports as JS
[23:34:29] [snowpack-astro] load() starting… [src/components/PersonPreview.astro]
[23:34:29] [snowpack-astro] ✔ load() success [src/components/PersonPreview.astro]
[23:34:29] [snowpack-astro] transform() starting… [src/components/PersonPreview.js]
[23:34:29] [snowpack-astro] ✔ transform() success [src/components/PersonPreview.js]
[23:34:29] [@snowpack/postcss-transform] transform() starting… [src/components/PersonPreview.js]
[23:34:29] [@snowpack/postcss-transform] ✔ transform() success [src/components/PersonPreview.js]
[23:34:29] [snowpack] Scanning src/components/PersonPreview.astro for imports as JS
[build] Unable to render src/pages/people/[person].astro
Error: __astro_slot encountered an unexpected child:
at file:///sandbox/src/pages/people/[person].astro
undefined
at __astro_slot (/_snowpack/pkg/astro.dist.internal.__astro_slot.v0.20.4.js:11:11)
at Object.h (/_snowpack/pkg/astro.dist.internal.h.v0.20.4.js:47:12)
at async Promise.all (index 0)
at async Object.h (/_snowpack/pkg/astro.dist.internal.h.v0.20.4.js:45:20)
at async Promise.all (index 0)
at async Object.h (/_snowpack/pkg/astro.dist.internal.h.v0.20.4.js:45:20)
at async Promise.all (index 0)
at async Object.h (/_snowpack/pkg/astro.dist.internal.h.v0.20.4.js:45:20)
[build] ✕ building pages failed!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment