Skip to content

Commit dadf5e5

Browse files
committed
Enhanced talks page PoC
Signed-off-by: Radu Nichita <radunichita99@gmail.com>
1 parent c11f23b commit dadf5e5

File tree

6 files changed

+1554
-1358
lines changed

6 files changed

+1554
-1358
lines changed

docusaurus.config.ts

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,44 @@ import { execSync } from "child_process";
66
const remarkEmbedder = require("@remark-embedder/core");
77
const YouTubeTransformer = require("./src/components/youtube-transformer.js");
88

9-
// Note: This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
10-
11-
let branchName = process.env.NETLIFY ? process.env.HEAD : "main";
12-
// Get the current branch name using git command
13-
try {
14-
const output = execSync("git branch --show-current", {
15-
encoding: "utf-8",
16-
}).trim();
17-
if (output) {
18-
branchName = output;
19-
}
20-
console.log(`Current branch: ${branchName}`);
21-
} catch (err) {
22-
console.error(`Error determining branch name: ${err}`);
23-
}
9+
// ... (Your existing branch name logic here) ...
2410

2511
const config: Config = {
2612
title: "The Beman Project",
2713
tagline: "Tomorrow's C++ Standard Libraries Today",
2814
favicon: "./img/beman_logo.png",
29-
30-
// Set the production url of your site here
3115
url: "https://bemanproject.org/",
32-
// Set the /<baseUrl>/ pathname under which your site is served
33-
// For GitHub pages deployment, it is often '/<projectName>/'
3416
baseUrl: "/",
35-
36-
// GitHub pages deployment config.
37-
organizationName: "bemanproject", // Usually your GitHub org/user name.
38-
projectName: "website", // Usually your repo name.
39-
17+
organizationName: "bemanproject",
18+
projectName: "website",
4019
onBrokenLinks: "throw",
4120
onBrokenMarkdownLinks: "warn",
4221

43-
// Even if you don't use internationalization, you can use this field to set
44-
// useful metadata like html lang. For example, if your site is Chinese, you
45-
// may want to replace "en" with "zh-Hans".
4622
i18n: {
4723
defaultLocale: "en",
4824
locales: ["en"],
4925
},
5026

5127
staticDirectories: ["static", "images"],
5228

29+
plugins: [
30+
() => ({
31+
name: "yaml-loader-plugin",
32+
configureWebpack() {
33+
return {
34+
module: {
35+
rules: [
36+
{
37+
test: /\.ya?ml$/,
38+
use: "yaml-loader",
39+
},
40+
],
41+
},
42+
};
43+
},
44+
}),
45+
],
46+
5347
presets: [
5448
[
5549
"classic",
@@ -69,10 +63,9 @@ const config: Config = {
6963
remarkPlugins: [
7064
[remarkEmbedder, { transformers: [YouTubeTransformer] }],
7165
],
72-
// Blogging config
7366
onInlineTags: "warn",
7467
onInlineAuthors: "warn",
75-
onUntruncatedBlogPosts: "throw", // Enforce truncation of blog posts for previews of blog posts.
68+
onUntruncatedBlogPosts: "throw",
7669
},
7770
theme: {
7871
customCss: "./src/css/custom.css",
@@ -82,7 +75,7 @@ const config: Config = {
8275
],
8376

8477
themeConfig: {
85-
//TODO: Replace with your project's social card
78+
// ... (Your existing theme config) ...
8679
image: "./img/beman_logo.png",
8780
navbar: {
8881
title: "The Beman Project",
@@ -98,7 +91,7 @@ const config: Config = {
9891
label: "Docs",
9992
},
10093
{ to: "/libraries", label: "Libraries", position: "left" },
101-
{to: "/talks", label: "Talks", position: 'left'},
94+
{ to: "/talks", label: "Talks", position: 'left'},
10295
{ to: "/blog", label: "Blog", position: "left" },
10396
{
10497
"aria-label": "Discourse Forum",
@@ -122,8 +115,7 @@ const config: Config = {
122115
theme: prismThemes.github,
123116
darkTheme: prismThemes.dracula,
124117
},
125-
discourseUrl: "https://discourse.bemanproject.org/", // Temporary change, re-deploy.
126118
} satisfies Preset.ThemeConfig,
127119
};
128120

129-
export default config;
121+
export default config;

package-lock.json

Lines changed: 71 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"@docusaurus/module-type-aliases": "3.7.0",
3030
"@docusaurus/tsconfig": "3.7.0",
3131
"@docusaurus/types": "3.7.0",
32-
"typescript": "~5.6.2"
32+
"typescript": "~5.6.2",
33+
"yaml-loader": "^0.9.0"
3334
},
3435
"browserslist": {
3536
"production": [

src/pages/talks.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/pages/talks.mdx

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: Talks
3+
slug: talks
4+
hide_table_of_contents: true
5+
---
6+
7+
import authors from '@site/blog/authors.yml';
8+
9+
export const TalkPost = ({ title, date, duration, videoId, authorId }) => {
10+
const author = authors[authorId];
11+
12+
// Safety check: if authorId is wrong, show error or fallback
13+
if (!author) {
14+
return <div className="alert alert--danger">Author ID "{authorId}" not found in authors.yml</div>;
15+
}
16+
17+
const githubLink = author.socials?.github ? `https://github.com/${author.socials.github}` : null;
18+
19+
return (
20+
<article className="margin-bottom--xl">
21+
<header>
22+
<h2 style={{ marginBottom: '0.5rem', fontSize: '2rem' }}>
23+
<a href="#" style={{ textDecoration: 'none' }}>{title}</a>
24+
</h2>
25+
26+
<div className="margin-bottom--md" style={{ color: 'var(--ifm-color-content-secondary)', fontSize: '0.9rem' }}>
27+
<time>{date}</time> · {duration}
28+
</div>
29+
30+
{/* AUTHOR ROW (Populated from YAML) */}
31+
<div className="avatar margin-bottom--lg">
32+
<a
33+
className="avatar__photo-link avatar__photo avatar__photo--lg"
34+
href={author.url}
35+
target="_blank"
36+
>
37+
<img
38+
alt={author.name}
39+
src={author.image_url}
40+
/>
41+
</a>
42+
<div className="avatar__intro">
43+
<div className="avatar__name">
44+
<a href={author.url} target="_blank" rel="noopener noreferrer">
45+
{author.name}
46+
</a>
47+
</div>
48+
<small className="avatar__subtitle">
49+
{author.title}
50+
</small>
51+
52+
{/* Social Icons */}
53+
<div style={{ display: 'flex', gap: '8px', marginTop: '4px' }}>
54+
{githubLink && (
55+
<a href={githubLink} target="_blank" style={{color: 'inherit'}} title="GitHub">
56+
<svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" strokeWidth="2" fill="none" strokeLinecap="round" strokeLinejoin="round"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path></svg>
57+
</a>
58+
)}
59+
</div>
60+
</div>
61+
</div>
62+
</header>
63+
64+
{/* VIDEO SECTION */}
65+
<div style={{
66+
position: 'relative',
67+
paddingBottom: '56.25%',
68+
height: 0,
69+
overflow: 'hidden',
70+
borderRadius: '8px',
71+
marginBottom: '1rem',
72+
backgroundColor: '#000',
73+
border: '1px solid var(--ifm-color-emphasis-200)'
74+
}}>
75+
<iframe
76+
src={`https://www.youtube.com/embed/${videoId}`}
77+
style={{position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', border: 0}}
78+
allowFullScreen
79+
title={title}
80+
/>
81+
</div>
82+
83+
<hr className="margin-vert--xl" />
84+
</article>
85+
);
86+
};
87+
88+
# Talks
89+
90+
<TalkPost
91+
title="The Beman Project: Bringing Standard Libraries to the next level"
92+
date="October 24, 2024"
93+
duration="70 min watch"
94+
videoId="f4JinCpcQOg"
95+
authorId="camio"
96+
/>
97+
98+
<TalkPost
99+
title="Creating a sender / receiver framework"
100+
date="September 15, 2024"
101+
duration="60 min watch"
102+
videoId="Nnwanj5Ocrw"
103+
authorId="dietmarkuehl"
104+
/>

0 commit comments

Comments
 (0)