Skip to content
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
5 changes: 1 addition & 4 deletions src/components/EventLanding.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ export default function EventLanding({ slug }) {
};

return (
<Layout
title={isZh ? event.title.zh : event.title.en}
description={isZh ? event.description.zh : event.description.en}
>
<Layout title={pick(locale, event.title)} description={pick(locale, event.description)}>
{bannerUrl && (
<Head>
<meta property="og:image" content={`${siteConfig.url}${bannerUrl}`} />
Expand Down
3 changes: 0 additions & 3 deletions src/pages/landing/kcd-vietnam.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/pages/landing/kubecon-japan.js

This file was deleted.

18 changes: 18 additions & 0 deletions src/plugins/events/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ical from "node-ical";
import landingEvents from "../../data/events";

export default function pluginEvents(context, options) {
const { sources } = options;
Expand All @@ -11,6 +12,10 @@ export default function pluginEvents(context, options) {
return {
name: "plugin-events",

getPathsToWatch() {
return [require.resolve("../../data/events")];
},

async loadContent() {
const now = new Date();
now.setHours(0, 0, 0, 0);
Expand Down Expand Up @@ -59,6 +64,19 @@ export default function pluginEvents(context, options) {

async contentLoaded({ content, actions }) {
actions.setGlobalData({ events: content });
const basePath = context.baseUrl.endsWith("/")
? context.baseUrl.slice(0, -1)
: context.baseUrl;
for (const event of landingEvents) {
actions.addRoute({
path: `${basePath}/landing/${event.slug}`,
component: "@site/src/components/EventLanding.js",
exact: true,
props: {
slug: event.slug,
},
});
}
},
};
}