Open rawkode opened 4 years ago
@rawkode Thanks for checking out the repo! 🤘
This project is setup moreso for creating one-off talks since the [slide].js
page just grabs all the slides and uses them, and there's no way currently to use something like folders to separate talks.
Best way to do it without editing the repo source?: Keep reusable slide content in separate MDX, JSX, etc files and import them into your slides as needed. MDX allows you to import other files into it and use them, so if you have content that's used often, you can import it across other slides. The reusable slides can be kept in a different repo that you can link to this one, and import as needed (or create a monorepo).
You could also create each talk as a page? (so 1.mdx is one talk, 2.mdx is another). And all slides are in one MDX files, and you import any reusable slides. But they'd navigate to eachother at the end of each talk, which might be weird. And makes the MDX file huge if the talk is large.
If you want to fork it though, you'd have to edit the layouts/SlidePage.js
to accept a prop for the slide directory/URL, instead of using /slide/<number>
for the pagination. This could get passed through the talk itself, since each MDX file has to contain the <SlidePage>
wrapper anyway. And you could use Next's URL context to grab the slide directory from the URL, and then grab posts from there instead of the /slides
root directory. You'd use Next's "catch-all routes" to do something like /slides/<talk-name>/<number>
.
Not sure if I'd add this as a native feature? If more people are interested I can definitely implement it into the core, feel free to react to this or comment below 👍 I'll leave this one open for more discussion 💬📣
@rawkode Kinda implemented something like this if you're interested.
Added a branch that allows for nested talks. You can change the default redirect in the site.config.js
to the nested talk, or just link directly to it and should work.
This should allow for sharing of components between talks 🥳♻️
Going to do some testing myself on it, but will probably merge this into master since it shouldn't have any breaking changes 👍
https://github.com/whoisryosuke/next-mdx-deck/tree/nested-talks
Hi @whoisryosuke
Thanks, this looks promising. I'll do some experimenting
Hi,
I was wondering if it's possible to remove this constraint? I like to re-use a lot of slides across various talks; for this, I'd rather be able to provide
talk.ts
file that imported each of my slides in the order I wish to present them.Is this possible?