Skip to content

Latest commit

 

History

History
57 lines (48 loc) · 2.25 KB

File metadata and controls

57 lines (48 loc) · 2.25 KB

PR Podcast website

This is the repo for generating PR podcast website. In essence, this is a simple static site generator with no dependencies.

Run

  • Make sure you have node installed - No need to run npm install
  • Build your website:
    • ./build.sh serve build, serve and watch the repo
    • ./build.sh test to run the tests
    • ./build.sh to generate the website in docs directory

Structure

All the contents for the website are int site directory:

  • content: Markdown files for posts
  • static: Static files, which can have templates
  • layout: Layouts that can be reused in posts and pages
  • include: Partial HTML files that can be included in other HTML files

Templates

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 are:
    • % include will add the HTML file from include directory.

Variables

  • In every page you have access to all the values defined config.json file, e.g. ${ site.title }

Pages

All the files in static directory are pages. They have access to:

  • posts: List containing all the posts data

Posts

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 FrontMatter
  • content: Post content
  • url: Post relative URL from base URL
  • publishDate: Post publish date, from file name

Issues

  • Why the docs directory is included in the repo? I tried to build the docs 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.

TODO

  • Update links in header and footer
  • Deploy with Github actions
  • formspree in configs
  • Add Tailwind
  • Rename static dir - Pages are there too
  • Remove TS please
  • Add proper 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