We have a lot of social media links and things change all the time. We don’t want to pay people to change templates to account for this so we try to keep dynamic data in config files and here is an example of how we do this:
in our config.toml
# Podcast Feed Links
podcastchannels = [ ["iTunes","https://itunes.apple.com/gb/podcast/learn-english-through-listening/id1134891957"],
["Spotify","https://open.spotify.com/show/7ixeOS7ezPTZSaISIx2TTw"],
["TuneIn","https://tunein.com/podcasts/Educational/Learn-English-Through-Listening-p888646/"],
["Stitcher","https://www.stitcher.com/podcast/adept-english-podcast-series/learn-english-through-listening-podcast-series?refid=stpr"],
["BluBrry","https://www.blubrry.com/adeptenglish/"],
["PodBean","https://www.podbean.com/podcast-detail/qpp5u-436c6/Learn+English+Through+Listening"],
["Google","https://play.google.com/music/m/Ick5cnoda663a262rrv6cdpjtnm"],
["PlayerFM","https://player.fm/series/series-1511313"] ]
Then in our footer template we use this information like this:
<div class="column is-one-half-mobile">
<h3 class="is-size-6 has-text-white-ter">
🎧 listen to us
</h3>
<div class="columns is-mobile is-multiline">
{% if config.extra.podcastchannels %}
{% for channel in config.extra.podcastchannels %}
<a href="{{channel | last}}" target="_blank"><div class="column has-text-white-ter">🎙️{{ channel | first }}</div></a>
{% endfor %}
{% endif%}
<br>
</div>
</div>
We are using Bulma for our styles so excuse the classes if you don’t.