Commit 1d0065ca by PLN (Algolia)

feat: Talks

parent 35824fea
---
title: Collaborer avec d'autres métiers
date: "2020-04-21"
url: https://nech.pl/bigday2020-video
slides: https://nech.pl/bigday2020
---
---
title: The Musicologist, or Search as a Conversation
date: '2017-11-23'
url: https://www.youtube.com/watch?v=3eb4KMNcOII
---
<!-- slides: https://nech.pl/bigday2020 -->
import {getAllContentData, getAllContentIds, getContentData} from './utils' import {getAllContentData, getAllContentIds, getContentData} from './utils'
export function getSortedPostsData() { export function getPostsData() {
return getAllContentData('posts', true) return getAllContentData('posts', true)
} }
......
import {getAllContentData, getAllContentIds, getContentData} from './utils'
export function getTalksData() {
return getAllContentData('talks', true)
}
export function getAllPostIds() {
return getAllContentIds("talks")
}
export async function getPostData(id) {
return getContentData("talks", id)
}
...@@ -3,18 +3,21 @@ import Link from "next/link"; ...@@ -3,18 +3,21 @@ import Link from "next/link";
import Date from "../components/date"; import Date from "../components/date";
import Layout from "../components/layout"; import Layout from "../components/layout";
import utilStyles from "../styles/utils.module.css"; import utilStyles from "../styles/utils.module.css";
import { getSortedPostsData } from "../lib/posts"; import { getPostsData } from "../lib/posts";
import { getTalksData } from "../lib/talks";
export async function getStaticProps() { export async function getStaticProps() {
const allPostsData = getSortedPostsData(); const allPostsData = getPostsData();
const allTalksData = getTalksData();
return { return {
props: { props: {
allPostsData, allPostsData,
allTalksData,
}, },
}; };
} }
export default function Home({ allPostsData }) { export default function Home({ allPostsData, allTalksData }) {
return ( return (
<div className="container"> <div className="container">
<Layout home> <Layout home>
...@@ -59,6 +62,22 @@ export default function Home({ allPostsData }) { ...@@ -59,6 +62,22 @@ export default function Home({ allPostsData }) {
</p> </p>
</section> </section>
<section className={`${utilStyles.headingMd} ${utilStyles.padding1px}`}> <section className={`${utilStyles.headingMd} ${utilStyles.padding1px}`}>
<h2 className={utilStyles.headingLg}>Talks</h2>
<ul className={utilStyles.list}>
{allTalksData.map(({ id, date, title, url, slides }) => (
<li className={utilStyles.listItem} key={id}>
<Link href={`/posts/${id}`}>
<a href={url}>{title}</a>
</Link>
<br />
<small className={utilStyles.lightText}>
<Date dateString={date} />
</small>
</li>
))}
</ul>
</section>
<section className={`${utilStyles.headingMd} ${utilStyles.padding1px}`}>
<h2 className={utilStyles.headingLg}>Blog</h2> <h2 className={utilStyles.headingLg}>Blog</h2>
<ul className={utilStyles.list}> <ul className={utilStyles.list}>
{allPostsData.map(({ id, date, title }) => ( {allPostsData.map(({ id, date, title }) => (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment