https://github.com/audrow/sta-website-post-loader
https://github.com/audrow/sta-website-post-loader
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/audrow/sta-website-post-loader
- Owner: audrow
- License: mit
- Created: 2022-01-21T16:03:20.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T07:02:26.000Z (over 3 years ago)
- Last Synced: 2025-03-11T04:38:03.187Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@sta-podcast/post-loader
- Size: 1.71 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# README
This repo exposes posts through the `PostLoader` class, which loads all posts and their includes in a directory.
Post data can be formatted in Typescript (and will be dynamically imported, which may not work in all settings) or YAML.
Note that posts need to match the types in `PostFileData`, and the `getPost` method returns a `Post` or `SerializedPost` object, which has additional data inferred; for example:
- SRT files are turned into lists of objects with who is speaking and the time they started
- Outline files are turned into lists of objects with the time the started and the title
- The MP3 url and the post url are inferred
In addition, a list of tags are computed for the posts and posts can be searched by tag.
A convenient way to get an initialized `PostLoader` is to use the `createPostLoader` function that is the default export.
## Setup
### Install
```bash
$ npm install @sta-podcast/post-loader
```
### For Local Development
Clone this repo then run
```bash
npm ci # clean install
npm run prepare # setup Git Hooks
```