Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add episode numbers as an option #67

Closed
mattstratton opened this issue May 3, 2017 · 5 comments · Fixed by #322
Closed

Add episode numbers as an option #67

mattstratton opened this issue May 3, 2017 · 5 comments · Fixed by #322

Comments

@mattstratton
Copy link
Owner

It would be useful to be able to specify an episode number in the frontmatter of an episode, which would then be able to take a prefix from the config file to append to the title on the display, as it is done on https://www.arresteddevops.com.

For example, config.toml would have a field called episode_prefix, like "ADO", and then that would generate a title like

My Episode - ADO89

@mattstratton mattstratton added this to the v.1.0 milestone May 3, 2017
@mattstratton mattstratton modified the milestones: 1.0, Next Tasks May 30, 2017
@mattstratton
Copy link
Owner Author

So I think code looks something like

$.Scratch.Set "episode_prefix" ""
{{ with $.Site.Params.episode_prefix }}
  {{ $.Scratch.Set "episode_prefix" "(" }}
  {{ $.Scratch.Add "episode_prefix" $.Site.Params.episode_prefix }}
  {{ $.Scratch.Add "episode_prefix" ")" }}
 {{end}}
 
{{.Title}}{{ with .Params.episode_number }}&nbps;{{ . }}{{ $.Scratch.Get "episode_prefix }}{{ end }}

Could even get tricker and add an optional field to specify what should surround the episode number (parens or square braces, etc)

@mattstratton mattstratton removed this from the Next Tasks milestone Feb 10, 2018
@mattstratton
Copy link
Owner Author

I have confused myself and don't know why I was going to do the parens around it. From what I can tell in the example, it would output something like My Episode (ADO89) not My Episode - ADO98.

Also the code is bad because I already have the value of %.Site.Params.episode_prefix available in the . from the with statement :)

@mattstratton
Copy link
Owner Author

but I think you could do like three options, set with episode_number_style in the config, like this (these are the three options):

[params]
episode_number_style  = "parens"
episode_number_style = "brackets"
episode_number_style = "dash"

which would result in the following:
My Episode (ADO89)
My Episode [ADO89]
My Episode - ADO89

@mattstratton
Copy link
Owner Author

as another update so I don't forget - the episode = "" already exists in frontmatter, and is used in the feed:

          {{ with .Params.episode }}
          <itunes:episode>{{ . }}</itunes:episode>
          {{ end }}

@mattstratton
Copy link
Owner Author

This is connected to #67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant