Skip to content

Adding an episode to the site

Max Glenister edited this page Jun 30, 2024 · 3 revisions

You can pretty much just copy an existing episode data file and start from there.

Attributes

  • title
  • description
  • pubDate
  • duration
  • length
  • author *
  • explicit *
  • name *

title attribute

The title of the episode. Keep this to a short sentence.

description attribute

This can either be a long single sentence on one line, or across multiple:

description: This is a valid example of the description
description: "This is a valid example of the description"
description: >-
    This is a valid example of the description

pubDate attribute

These need to be unique or the ordering gets all weird.

duration attribute

This is the duration in minutes and seconds.

You can use afinfo and some grep/awk on macos to gather this:

# on macos
afinfo file.m4a | grep duration | awk '{seconds=$3; hours=int(seconds/3600); minutes=int((seconds%3600)/60); seconds=int(seconds%60); printf "%02d:%02d:%02d\n", hours, minutes, seconds}'

or alternatively open the file in a media player and note the duration

length attribute

To get the length, use your terminal and the stat command:

# Output the size of each of the m4a files in the audio directory
cd audio
# linux
for file in *.m4a; do echo -e "$file: $(stat -c%s "$file")"; done
# macos
for file in *.m4a; do echo -e "$file: $(stat -f%z "$file")"; done
# Output the size of a single m4a
# linux
stat -c%s file.m4a
# macos
stat -f%z file.m4a

author attribute

Optional. If none is specified this takes the value from site.feed.author.

explicit attribute

Optional. If none is specified this takes the value from site.feed.explicit.

name attribute

Optional. If none is specified this does some trickery to determine the base filename without extension.

_episodes/02.yml     # 2, with the leading zero removed
_episodes/10.yml     # 10
_episodes/40-foo.yml # 40, the text after the number is removed when we coerce the name to a number.