From 3cff05e9ec7f1aa69bd79d5a9b7049c3ad840fe9 Mon Sep 17 00:00:00 2001 From: Matt Stratton Date: Wed, 3 May 2017 13:41:12 -0500 Subject: Add optional banner to images Fixes #60 --- README.md | 5 +++- config.codekit3 | 18 -------------- exampleSite/content/episode/aug.md | 1 + exampleSite/static/img/episode/default-banner.jpg | Bin 0 -> 116684 bytes layouts/episode/single.html | 29 +++++++++++++++++----- layouts/partials/row.html | 27 +++++++++++++++++++- 6 files changed, 54 insertions(+), 26 deletions(-) create mode 100644 exampleSite/static/img/episode/default-banner.jpg diff --git a/README.md b/README.md index 36206c0..aac151f 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ author = "Matt" date = "2016-09-25T04:10:01-05:00" episode = "12" episode_image = "img/episode/default.jpg" +episode_banner = "img/episode/default-banner.jpg" explicit = "no" guests = ["jsmith"] images = ["img/episode/default-social.jpg"] @@ -132,7 +133,9 @@ Graphical user interface influencer value proposition startup hackathon iPad ana | `author` | No | The name of an author from your config.toml file | "Matt" | | `date` | Yes | The release date of the episode. The `hugo new` episode will pre-populate this, but you may want to adjust it. | "2016-09-25T04:10:01-05:00" | | `episode` | No | The episode number. Currently unused. | "12" | -| `episode_image` | Yes | The square thumbnail to represent the episode. A default image is provided, and the archetype will pre-populate it. This image needs to be relative to your baseURL. | "img/episode/default.jpg" | +| `episode_image` | Yes | The square thumbnail to represent the episode. A default image is provided, and the archetype will pre-populate it. This image needs to be relative to your baseURL. | "img/episode/default.jpg" + | + | `episode_banner` | No | The banner to represent the episode. This image needs to be relative to your baseURL. This image will be display at the top of the episode page, as well as the top of the home page for the most recent episode. Recommend that it is at least 1024 pixels wide. | "img/episode/default-banner.jpg" | `explicit` | Yes | Whether or not the episode contains explicit content. Default value from the archetype is "no". Valid values are "yes" or "no" | "yes" | | `guests` | No | If your episode has guests, populate the `guests[]` array with a comma-separated list of their names. If there is only one guest, no comma is needed. | ["jdoe", "msmith", "gbluth"] or ["jsmith]" | | `images` | No | The social sharing image used by Facebook, Twitter, etc. The archetype will populate this with a default sharing image. This image needs to be relative to your baseURL | ["img/episode/default-social.jpg"] | diff --git a/config.codekit3 b/config.codekit3 index b0c601f..aa0ed49 100644 --- a/config.codekit3 +++ b/config.codekit3 @@ -4893,24 +4893,6 @@ "rFN": 0, "uCM": 0 }, - "\/exampleSite\/content\/episode\/matt-rules.md": { - "cS": 0, - "eF": 1, - "eL": 1, - "eLB": 0, - "ema": 1, - "eSQ": 1, - "ft": 4096, - "oA": 1, - "oAP": "\/exampleSite\/content\/episode\/matt-rules.html", - "oF": 0, - "oFM": 0, - "oS": 0, - "pHT": 0, - "pME": 1, - "rFN": 0, - "uCM": 0 - }, "\/exampleSite\/content\/episode\/may.md": { "cS": 0, "eF": 1, diff --git a/exampleSite/content/episode/aug.md b/exampleSite/content/episode/aug.md index c01c72d..c4018aa 100644 --- a/exampleSite/content/episode/aug.md +++ b/exampleSite/content/episode/aug.md @@ -6,6 +6,7 @@ categories = [] date = "2016-08-25T04:09:58-05:00" episode = "11" episode_image = "img/episode/default.jpg" +episode_banner = "img/episode/default-banner.jpg" explicit = "no" guests = ["mstratton"] images = ["img/episode/default-social.jpg"] diff --git a/exampleSite/static/img/episode/default-banner.jpg b/exampleSite/static/img/episode/default-banner.jpg new file mode 100644 index 0000000..d83a130 Binary files /dev/null and b/exampleSite/static/img/episode/default-banner.jpg differ diff --git a/layouts/episode/single.html b/layouts/episode/single.html index f05bccf..266d203 100644 --- a/layouts/episode/single.html +++ b/layouts/episode/single.html @@ -6,14 +6,31 @@ -
-
- + {{ if isset .Params "episode_banner" }} + {{ if ne .Params.episode_banner "" }} +
+
+
-
- {{ .Description | markdownify }}
-
+
+
+ {{ .Description | markdownify }} +
+
+ {{ end }} + {{ else }} + +
+
+ +
+
+ {{ .Description | markdownify }} +
+
+ + {{ end }}
-- cgit v1.2.3