Search code examples
yamljekyllitunesgithub-pagespodcast

Jekyll - data files and structured YAML


I'm using a Jekyll template for podcast site and RSS, including iTunes info. Now, my podcast.yml file is like this :

name: "Fate Masters" 
gpluspage: "https://plus.google.com/communities/100913016060492249875" 
copyright: (CC BY-NC-SA) 2015 - Fate Masters 
language: pt-br 
podcast_links: 
    - format: MP3 
      link: http://feeds.feedburner.com/FateMastersRPG 
    - format: OGG 
      link: http://feeds.feedburner.com/FateMastersRPG-OGG 
 itunes-explicit: "NO" 
 itunes-keywords: "RPG, Fate, Fate Básico, Mestre, Narrador" 
 itunes-podcast_image: /images/FateMasters.jpg 
 itunes-author: "Fate Masters" 
 itunes-email: [email protected] 
 itunes-categories: 
     - RPG 
     - Fate 
     - Fate Core 
     - Fate Básico

However... See all those itunes-* tags... I like to put this as an itunes structured info with pairs like - categories and so... But I can't do this, because using site.podcast.itunes.copyright would return nothing...

Any tips


Solution

  • If your file is a data file, you will have to put all you podcasts in this same file.

    In order to do this, you will have to reformat a little :

    - name: "Fate Masters"
      gpluspage: "https://plus.google.com/communities/100913016060492249875"
      copyright: (CC BY-NC-SA) 2015 - Fate Masters
      language: pt-br
      podcast_links:
        - format: MP3
          link: http://feeds.feedburner.com/FateMastersRPG
        - format: OGG
          link: http://feeds.feedburner.com/FateMastersRPG-OGG
      itunes:
        explicit: "NO"
        keywords: "RPG, Fate, Fate Básico, Mestre, Narrador"
        podcast_image: /images/FateMasters.jpg
        author: "Fate Masters"
        email: [email protected]
        categories:
         - RPG
         - Fate
         - Fate Core
         - Fate Básico
    
    - name: "other"
      copyright: MIT
    

    Then you can loop over podcasts like this :

    {% for p in site.data.podcast %}
    <h2>{{ p.name }}</h2>
    <p>{{ p.copyright }}</p>
    {% endfor %}