This is the repo for generating PR podcast website. In essence, this is a simple static site generator with no dependencies.
- Use
nvm
to make sure you have the right version:nvm use
- Run
npm install
to install Typescript and Node Types - Build the project:
./build.sh
to generate the website indocs
directory./build.sh test
to run the tests./build.sh serve
build and serve the website
All the contents for the website are int site
directory:
content
: Markdown files for postsstatic
: Static files, which can have templates (TODO: Rename)layout
: Layouts that can be used in postsinclude
: Partial HTML files that can be included in other HTML files
We have our own template engine. Rules are simple:
- You can write JS code in lines starting with
%
:% let name = 5
- Literal templates (
${}
) are evaluated as JS values:<p> Hello ${ name }</p>
- Special commands:
% include
will add the HTML file frominclude
directory.
- In every page you have access to all the values defined
config.json
file:${ site.title }
All the files in static directory are pages. They have access to:
posts
: List containing all the posts data
Posts are in site/content
directory and their file name should in this format: YYYY-MM-DD-title.md
. Every post has access to:
post
: Collection of the post data defined in FrontMattercontent
: Post contenturl
: Post relative URL from base URLpublishDate
: Post publish date, from file name
- Why the
docs
directory is included in the repo? I tried to build thedocs
on CloudFlare and then serve the directory. For some reason it didn't work (Couldn't find the pages). I also tried the same thing on Netlify and again, the same problem.
- Add Markdown support for posts
- All data defined in Front-Matter should be accessible in the template
- Make transformations faster
- Parse lists in Front-Matter
- Install
serve
locally - Remove
.posts_cache.json
from root directory