Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise 9: link to speaker pages #12

Open
wants to merge 7 commits into
base: 08-generate-speaker-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions site/src/components/talkCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import React from "react";
import { Link } from "gatsby";

export default function TalkCard({ talk }) {
const { name, title, time, avatar, link = "" } = talk;
const { name, title, time, avatar, fields } = talk;
const { slug = "" } = fields;

return (
<Link to={link}>
<Link to={slug}>
<div className="flex items-center hover:bg-indigo-100 border px-4 py-2">
<img
className="w-10 h-10 rounded-full mr-4"
Expand Down
3 changes: 3 additions & 0 deletions site/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ function IndexPage() {
name
title
time
fields {
slug
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions site/src/templates/speaker-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ export default function SpeakerPage({ data }) {
const speaker = data.speakersYaml;
return (
<Layout>
<div>
<div>
<h1 className="text-5xl font-extrabold text-blue-500 tracking-tight font-inter p-4">
{speaker.title}
</h1>
<h2 className="text-4xl font-extrabold tracking-tight font-inter p-4">
with {speaker.name}
</h2>
</div>
</div>
</Layout>
);
}
Expand Down