Building a Podcasting Platform with Grav

Finding Balance

DB Backed

  • Great Administration interface
  • Live production editing
  • User permissions
  • Password protected areas
  • Personalization
  • Web forms
  • User submitted content
  • WYSIWYG Editors

Flat-file Generated

  • Content tied to functionality
  • Content Deployment
  • Configuration Deployment
  • Speed & Scale
  • Secure
  • Fewer server dependencies
  • More exact content entry
    (no copy/paste from Word fail)

CMS Benefits

  • Only requirement is PHP 5.5.9+ and a web server
  • Content is dynamically rendered (then cached)
  • Content is all in Markdown or HTML
  • Configuration is all in YAML
  • Twig templates (based on Jinja)
  • CLI for common tasks
  • Sub 100ms page loads
  • Impressive Admin UI (Optional)
    • User Logins
    • Production Content Entry
    • Production Configuration Changes
    • Markdown editor
    • Module installation and upgrades
    • Self upgrades
  • Core, Admin, and Skeleton Installs
  • Great Documentation

Anatomy of Grav Content

Content Architecture

/user/pages/01.blog/2014-11-30.pomade-bar/item.md

/user/pages/01.resume/default.md

content base path

page path

template name

YAML Frontmatter

Markdown Content

Using Frontmatter in Templates

---
title: Pomade/Hair Styling Bar
date: 11/30/2014
taxonomy:
  category: blog
  tag: [personal care, hair style, recipe]
description: "In the past I've used traditional spreadable pomade..."
slug: 2014/11/pomadehair-styling-bar
custom_data: "My Custom Data"
---
{{ page.title }}
{{ page.date }}
{{ page.taxonomy.category }}
{{ page.taxonomy.tag }}
{{ page.description }}
{{ page.slug }}
{{ page.header.custom_data }}

Content Types

  • Default Pages
  • Blog List
  • Modular
  • Custom!

Anatomy of a Podcast Feed

<rss xmlns:npr="https://www.npr.org/rss/" xmlns:nprml="https://api.npr.org/nprml" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
    <channel>
        <title>Up First</title>
        <link>http://www.npr.org/programs/morning-edition/</link>
        <description>
            <![CDATA[ ... ]]>
        </description>
        <copyright>Copyright 2015 NPR - For Personal Use Only</copyright>
        <generator>NPR API RSS Generator 0.94</generator>
        <language>en-us</language>
        <itunes:summary>
            <![CDATA[ ... ]]>
        </itunes:summary>
        <itunes:subtitle>
            <![CDATA[ ... ]]>
        </itunes:subtitle>
        <itunes:author>NPR</itunes:author>
        <itunes:block>no</itunes:block>
        <itunes:owner>
            <itunes:email>podcasts@npr.org</itunes:email>
            <itunes:name>NPR</itunes:name>
        </itunes:owner>
        <itunes:category text="News & Politics"/>
        <itunes:image href="https://media.npr.org/assets/img/2017/03/21/upfirst_sq-ffcb53c89446b62b66fefb97b9356ad49b31bc5d.png?s=1400"/>
        <image>
            <url>
                https://media.npr.org/assets/img/2017/03/21/upfirst_sq-ffcb53c89446b62b66fefb97b9356ad49b31bc5d.png?s=200
            </url>
            <title>Up First</title>
            <link>http://www.npr.org/programs/morning-edition/</link>
        </image>
        <lastBuildDate>Fri, 02 Jun 2017 05:28:00 -0400</lastBuildDate>
        <item>
            <!-- foreach episode -->
        </item>
    </channel>
</rss>
<rss xmlns:npr="https://www.npr.org/rss/" xmlns:nprml="https://api.npr.org/nprml" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
    <channel>
        <!-- ... -->
        <item>
            <title>Friday, June 2nd, 2017</title>
            <description>
                <![CDATA[...]]>
            </description>
            <pubDate>Fri, 02 Jun 2017 05:28:00 -0400</pubDate>
            <copyright>Copyright 2015 NPR - For Personal Use Only</copyright>
            <guid>cdd54f6a-9f99-4ea2-8b92-15693d7f490c</guid>
            <itunes:author>NPR</itunes:author>
            <itunes:summary>
                <![CDATA[...]]>
            </itunes:summary>
            <itunes:subtitle>
                <![CDATA[...]]>
            </itunes:subtitle>
            <itunes:image href="https://media.npr.org/assets/img/2017/06/02/thumbnail_3000x1688_wide-fde023c1eeb1861196a5f8346c7df5ee9d92e808.jpg?s=1400"/>
            <itunes:duration>775</itunes:duration>
            <itunes:explicit>no</itunes:explicit>
            <enclosure url="https://play.podtrac.com/npr-510318/npr.mc.tritondigital.com/NPR_510318/media/anon.npr-mp3/npr/upfirst/2017/06/20170602_upfirst_upfirst06022017.mp3?orgId=1&d=775&p=510318&story=531173196&t=podcast&e=531173196&ft=pod&f=510318" length="0" type="audio/mpeg"/>
        </item>
    </channel>
</rss>

Episode Format

Putting them together

What do we need Grav to do?

  • Media management (audio and images)
  • Allow podcast and episode metadata
  • Build an XML feed
  • HTML list and detail pages

Grav's Media Management

Podcast Type

  • Show Title
  • Subtitle
  • Owner
  • Description (use the main body)
  • Link to podcast page
  • Date
  • Cover Image
  • Keywords
  • Explicit
  • Category

Episode Type

  • Episode Title
  • Date
  • Author*
  • Description (use main body)
  • Audio File*
  • Duration
  • Subtitle*
  • Keywords*
  • Cover Image*

* = Optional

---
title: 'The Hype Show Podcast'
menu: 'The Hype Show'
podcast:
    subtitle: 'The podcast with the most hype around!'
    owner: 'Andrew Koebbe'
    email: andrew@koebbe.com
    author: 'Hype Crew'
    explicit: false
    cover: cover.jpg
    category: Hype
    subcategory: Super Hype
    keywords: 'hype, show, podcast, super-hype'
---

The Hype Show is a podcast investigating all things HYPE. Join Hypey Von Hypesalot and his sidekick Hypu! as they navigate the hype sea!

Podcast Content Item

---
title: 'Episode 1: Let the hype begin!'
date: '01-06-2017 12:06'
episode:
    duration: '02:19:33'
---

In this episode Hypey and Hypu storm the castle!

===

Episode notes go here...

- Check out this cool thing
- And this
- This is the site we talked about
- You should try to do this too!

Episode Content Item

Making an XML Feed

Templates dictate the type of output.

 

episode.html.twig

 

episode.xml.twig

---
title: 'The Hype Show Podcast'
menu: 'The Hype Show'
podcast:
    subtitle: 'The podcast with the most hype around!'
    owner: 'Andrew Koebbe'
    email: andrew@koebbe.com
    author: 'Hype Crew'
    explicit: false
    cover: cover.jpg
    category: Hype
    subcategory: Super Hype
    keywords: 'hype, show, podcast, super-hype'
content:
    items: '@self.children'
    limit: 10
    order:
        by: date
        dir: desc
    pagination: true
    url_taxonomy_filters: true
---

The Hype Show is a podcast investigating all things HYPE. Join Hypey Von Hypesalot and his sidekick Hypu! as they navigate the hype sea!

Podcast Content Item

Demo Time

Resources

Thank you!

Andrew Koebbe

@andrewkoebbe

http://blog.andrewkoebbe.com/talks

KCPUG Grav Podcast Platform

By akoebbe

KCPUG Grav Podcast Platform

Building a Podcasting Platform with Grav

  • 1,704