Skip to content

Commit

Permalink
Add guest functionality.
Browse files Browse the repository at this point in the history
Fixes #16
  • Loading branch information
mattstratton committed Sep 25, 2016
1 parent abaab5f commit 74f92c5
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 7 deletions.
47 changes: 45 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ After installing Castanet successfully it requires a just a few more steps to ge
You will need to add a handful of configuration items to your `config.toml` file. You can take a look at the [example site](http://github.com/mattstratton/castanet/blahblahblah) to see them in action. They are described below:

- `[params]`
- `homepage` - the fully qualified domain name of your homepage. This is different than the `BaseURL` setting, as it must be externally available for feed readers, and others. This must NOT end with a slash. Example: `"https://www.mattstratton.com"`
- ~`homepage` - the fully qualified domain name of your homepage. This is different than the `BaseURL` setting, as it must be externally available for feed readers, and others. This must NOT end with a slash. Example: `"https://www.mattstratton.com"`~
- `copyright_notice` - Your copyright information for the footer of the page. Can contain Markdown. Example: `"Copyright 2016 [Matt Stratton](https://www.mattstrattion.io)"`
- `itunes_subscribe` - The URL of your podcast in the iTunes store. Optional. Example: `"http://itunes.apple.com/us/podcast/arrested-devops/id773888088?mt=2&uo=4&at=11lsCi"`
- `android_subscribe` - The URL for your podcast for Android users. You can generate this URL at [Subscribe on Android](https://subscribeonandroid.com). Optional. Example: ``"http://subscribeonandroid.com/feeds.podtrac.com/VGAulpN7MY1U"``
Expand Down Expand Up @@ -62,7 +62,7 @@ You will need to add a handful of configuration items to your `config.toml` file
- `pinterest` - Optional. Example: `"nozzleio"`
- `instagram` - Optional. Example: `"nozzleio"`
- `youtube` - Name of the YouTube channel. Optional. Example: `"arresteddevops"`
- `linkedin` -LinkedIn profile name. Optional. This is the part that comes after the `https://www.linkedin.com/in/` in your profile URL. Example: `"mattstratton"`
- `linkedin` - LinkedIn profile name. Optional. This is the part that comes after the `https://www.linkedin.com/in/` in your profile URL. Example: `"mattstratton"`

- `[params.authors]` - you can have multiple authors avaialable; just make more of each
- `[params.authors.USERNAME]` - replace `USERNAME` with an author name. Example: `[params.authors.matt]`
Expand All @@ -75,6 +75,10 @@ You will need to add a handful of configuration items to your `config.toml` file
- `twitter` - Example: `mattstratton`
- `linkedin` - Example: `"mattstratton"`

#### A note about `BaseURL`

This theme is fairly dependent upon a proper `BaseURL` being set in the `config.toml`. This has to do with how the feed is generated as well as some of the social metadata (these things cannot be relative URL's). I'm fully aware that this can cause issues with some build systems, and I'm trying to work on a good solution for this.


#### Permalinks

Expand All @@ -86,3 +90,42 @@ I recommend the following permalink settings, although the theme will work just
about = "/:filename/"
episode = "/:filename/"
```

### Guests

If you don't have guests on your episodes, feel free to ignore this section.

#### Guest data files

Every guest on your show needs a corresponding data file in the `data/guests` directory of your site. Generally speaking, you should be able to name these however you like, but I have only tested it with the format `firstinitiallastname.yml`, i.e., for "John Doe" the file would be `jdoe.yml`.

A guest file takes the following structure:

```
name: jdoe
full_name: "John Doe"
thumbnail: "/img/guest/jdoe.jpg"
bio: "Spoon fresh pie ingredients groceries oranges luncheon farm. Broth chick peas Chinese food indie foods. Cream heating cheese food locally grown first class caramelize restaurant grocery shopping savory chick peas. Recommendations lovely starter soda herbes fridge chocolate eat better quinoa sausage java chef locally grown wholesome. Broil sweet sushi lasagna cream indian. Desert sour vegetarian sous-chef soda oven tasty eat better rice recommendations relish salt butter grape. Grocery shopping delicious Chinese food beets conserve ginger. Authentic blend drink sausage. Groceries sour desert. Take away lasagna consumer luncheon scent cookie beer groceries meals restaurants java cheese vegan chick peas."
homepage: "http://www.google.com"
github: "johndoe"
facebook: "johndoe"
twitter: "johndoe"
linkedin: "johndoe"
```

(See the example site for, well, examples)

- `name` - This MUST match the name you will refer to the guest as in your frontmatter. Ideally it is the same name as the file. Again, I prefer first initial lastname format. Required.
- `full_name` - The full name of the guest. This is what is displayed on the episode page, etc. Required.
- `thumbnail` - The image for the guest. This image must be 500 px x 500 px. You can either enter a value relative to your `BaseURL`, or a fully qualified URL. If you want to use the default, set this to `""`. Optional. If left blank, or not existent, a default image will be provided. You can replace this default image by putting a new 500 px x 500 px PNG image at `/static/img/guest/default-guest.png` in your site (not in the theme!)
- `bio` - The bio of your guest. You can use Markdown in here. If you use quotes, make sure to escape them. Required.
- `homepage` - Optional.
- `github` - Guest's GitHub username. Optional.
- `facebook` - Guest's Facebook username. Example: `matt.stratton`. Do not use the full URL. Optional.
- `twitter` - Guest's Twitter username, without the `@`. Optional.
- `linkedin` - LinkedIn profile name. Optional. This is the part that comes after the `https://www.linkedin.com/in/` in your profile URL. Example: `"mattstratton"`


#### Frontmatter

If your episode has guests, populate the `guests[]` array with a comma-separated list of their names. For example, `["jdoe", "msmith", "gbluth"]`. If there is only one guest, no comma is needed.
2 changes: 1 addition & 1 deletion exampleSite/content/episode/april.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ date = "2016-04-25T04:09:45-05:00"
episode = "7"
episode_image = "/img/episode/default.jpg"
explicit = "no"
guests = []
guests = ["jdoe"]
images = ["http://www.google.com/img/episode/default-social.jpg"]
news_keywords = []
podcast_duration = "1:08:22"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/episode/march.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ date = "2016-03-25T04:09:40-05:00"
episode = "6"
episode_image = "/img/episode/default.jpg"
explicit = "no"
guests = []
guests = ["jdoe", "msmith"]
images = ["/img/episode/default-social.jpg"]
news_keywords = []
podcast_duration = "1:08:22"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/episode/may.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ date = "2016-05-25T04:09:48-05:00"
episode = "8"
episode_image = "/img/episode/default.jpg"
explicit = "no"
guests = []
guests = ["gbluth"]
images = ["/img/episode/default-social.jpg"]
news_keywords = []
podcast_duration = "1:08:22"
Expand Down
8 changes: 8 additions & 0 deletions exampleSite/data/guests/gbluth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: gbluth
full_name: "George Michael Bluth"
bio: "Spoon fresh pie ingredients groceries oranges luncheon farm. Broth chick peas Chinese food indie foods. Cream heating cheese food locally grown first class caramelize restaurant grocery shopping savory chick peas. Recommendations lovely starter soda herbes fridge chocolate eat better quinoa sausage java chef locally grown wholesome. Broil sweet sushi lasagna cream indian. Desert sour vegetarian sous-chef soda oven tasty eat better rice recommendations relish salt butter grape. Grocery shopping delicious Chinese food beets conserve ginger. Authentic blend drink sausage. Groceries sour desert. Take away lasagna consumer luncheon scent cookie beer groceries meals restaurants java cheese vegan chick peas."
homepage: "http://www.google.com"
github: "faceblock"
facebook: "faceblock"
twitter: "faceblock"
linkedin: "faceblock"
9 changes: 9 additions & 0 deletions exampleSite/data/guests/jdoe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: jdoe
full_name: "John Doe"
thumbnail: "/img/guest/jdoe.jpg"
bio: "Spoon fresh pie ingredients groceries oranges luncheon farm. Broth chick peas Chinese food indie foods. Cream heating cheese food locally grown first class caramelize restaurant grocery shopping savory chick peas. Recommendations lovely starter soda herbes fridge chocolate eat better quinoa sausage java chef locally grown wholesome. Broil sweet sushi lasagna cream indian. Desert sour vegetarian sous-chef soda oven tasty eat better rice recommendations relish salt butter grape. Grocery shopping delicious Chinese food beets conserve ginger. Authentic blend drink sausage. Groceries sour desert. Take away lasagna consumer luncheon scent cookie beer groceries meals restaurants java cheese vegan chick peas."
homepage: "http://www.google.com"
github: "johndoe"
facebook: "johndoe"
twitter: "johndoe"
linkedin: "johndoe"
9 changes: 9 additions & 0 deletions exampleSite/data/guests/msmith.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: gbluth
full_name: "Mary Smith"
thumbnail: ""
bio: "Spoon fresh pie ingredients groceries oranges luncheon farm. Broth chick peas Chinese food indie foods. Cream heating cheese food locally grown first class caramelize restaurant grocery shopping savory chick peas. Recommendations lovely starter soda herbes fridge chocolate eat better quinoa sausage java chef locally grown wholesome. Broil sweet sushi lasagna cream indian. Desert sour vegetarian sous-chef soda oven tasty eat better rice recommendations relish salt butter grape. Grocery shopping delicious Chinese food beets conserve ginger. Authentic blend drink sausage. Groceries sour desert. Take away lasagna consumer luncheon scent cookie beer groceries meals restaurants java cheese vegan chick peas."
homepage: "http://www.google.com"
github: "marysmith"
facebook: "marysmith"
twitter: "marysmith"
linkedin: "marysmith"
Binary file added exampleSite/static/img/guest/jdoe.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 50 additions & 2 deletions layouts/episode/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,59 @@ <h2>Show Notes</h2>
{{ .Content }}
</div>
</div>
<div class = "row">
{{ if .Params.guests }}
<div class = "row"><!-- guests begin -->
<div class = "col-md-12">
<h2>Guests</h2>
</div>
<div class = "col-md-12">
{{ range $person :=.Params.guests }}
{{ if (isset $.Site.Data.guests $person) }}
{{ $p := (index $.Site.Data.guests $person) }}
<div class="row">
<div class="col-md-3">
{{ if and (isset $p "thumbnail") (ne $p.thumbnail "") }}
{{ if (eq (slicestr $p.thumbnail 0 4) "http") }}
<img alt = "{{ $p.full_name }}" src = "{{ $p.thumbnail}}" class="img-responsive" width = "250px">
{{ else }}
<img alt = "{{ $p.full_name }}" src = "{{ $.Site.BaseURL }}{{ $p.thumbnail}}" class="img-responsive" width = "250px">
{{ end }}
{{ else }}
<img alt = "{{ $p.full_name }}" src = "{{ $.Site.BaseURL }}/img/guest/default-guest.png" class="img-responsive" width = "250px" />
{{ end }}
</div>
<div class= "col-md-8">
<h2>{{ $p.full_name }}</h2>
{{ if isset $p "bio" }}
<p>{{ $p.bio | markdownify }}</p>
{{ end }}
{{ if isset $p "homepage" }}
<a href = "{{ $p.homepage}}"><i class="fa fa-home fa-2x"></i></a>
{{ end }}
{{ if isset $p "twitter" }}
<a href = "https://twitter.com/{{ $p.Twitter }}"><i class="fa fa-twitter-square fa-2x"></i></a>
{{ end }}
{{ if isset $p "github"}}
<a href = "https://github.com/{{ $p.GitHub}}"><i class="fa fa-github-square fa-2x"></i></a>
{{ end }}
{{ if isset $p "linkedin" }}
<a href = "{{ $p.LinkedIn}}"><i class="fa fa-linkedin-square fa-2x"></i></a>
{{ end }}
{{ if isset $p "facebook" }}
<a href = "{{ $p.Facebook}}"><i class="fa fa-facebook-square fa-2x"></i></a>
{{ end }}
</div>
{{ end }}
</div>
{{ end }}
</div>
</div><!-- guests end -->
{{ end }}
<div class = "row"><!-- sharing begins -->
<div class = "col-md-12">
<div id="share"></div>
</div>
</div>
</div><!-- sharing ends -->
<div class = "row"> <!-- pager begin -->
<div class = "col-md-12">
<nav>
Expand Down
Binary file added static/img/guest/default-guest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 74f92c5

Please sign in to comment.