Podcats
Make Podcast feeds with Typescript. 😺
See this in use at: https://github.com/sw-yx/react-static-podcast-hosting
install
yarn add -D podcats
important assumptions
this library assumes that you have a unique markdown file pointed to every podcast episode that supplies all the metadata for the rss feed.
The markdown file has dual purpose - its frontmatter and body content is used for both generating your podcast's static site (which of course you dont have to use if you really dont want to), AND to write your podcast RSS (including show notes!).
Expected Markdown + mp3 format
Markdown content is in /content/week0.md
---
title: YOUR TITLE HERE
episode: 0
date: 2019-01-06
mp3URL: episodes/week0.mp3
description: the first episode
---
YOUR SHOW NOTES/BLOGPOST HERE
and the mp3 should be in a folder that would correspond to the mp3URL
path, e.g. /public/episodes/week0.mp3
Again, see https://github.com/sw-yx/react-static-podcast-hosting for live deployed example.
Public APIs
grabContents
pass it an array of paths to your markdown files (see the assumptions above). No path resolution is done for you so be sure to do your own as demonstrated in the example.
; ;; // my markdown content is hosted at './content';;;
buildFeed
⚠️ For now it requires the result of
contents
fromgrabContents()
above
pass in a whole lot of configs (examples below), and get back a promise which returns a Feed
object. call its rss2()
method to output a string to write to a file (or respond in your Express server if you still do that sort of thing)
; ;;;; // usage example inside async function;
Exported Types
Many types have comments annotations so that they should pop up inline in your IDE. However they aren't complete and can always be better. happy to take PR's...
;;;;
TSDX Bootstrap
This project was bootstrapped with TSDX v0.3.0. This is beta software, don't rely on it yet.