farskid / xstate.tips

Tips and tricks of using xstate for UI Development
https://xstate.tips
18 stars 0 forks source link

Implement rss #29

Closed jamestthompson3 closed 3 years ago

jamestthompson3 commented 3 years ago

Each tip will be under a directory under /pages/example with an index.mdx for the content and a meta.js file. Each meta.js file must contain an exported meta variable with the interface as below:

interface Meta {
  title: string;
  description: string;
  pubDate: string;
  author: string;
  url: string;
}

It's also important for meta.js to be a CommonJS module since we reuse it in the script that generates RSS feed dynamically.

Each index.mdx file should also import the common Tip component and the meta variable and be like:

import { Tip } from "../../../components/Tip";
import { meta } from "./meta";

export default ({ children }) => <Tip meta={meta}>{children}</Tip>;

@jamestthompson3 might be nice to have web pack aliases for the components dir.

Generating the feed

node scripts/rss.js which scans the examples dir and generates a feed.xml under public with all the collected tips.