diff --git a/REFERENCE.md b/REFERENCE.md index d7405438..4f5b893d 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -1,8 +1,29 @@ # Reference for castanet # Table of contents - -autoauto- [Reference for castanet](#reference-for-castanet)auto- [Table of contents](#table-of-contents)auto - [The config file](#the-config-file)auto - [Top-level items](#top-level-items)auto - [General Parameters](#general-parameters)auto - [Feed Parameters](#feed-parameters)auto - [Social Parameters](#social-parameters)auto - [Host/Author Parameters](#hostauthor-parameters)auto - [Host Social Parameters](#host-social-parameters)auto - [Link Parameters](#link-parameters)auto - [A note about `BaseURL`](#a-note-about-baseurl)auto - [Pagination setting with grid layout](#pagination-setting-with-grid-layout)auto - [Permalinks](#permalinks)auto - [Menus](#menus)auto - [Podlove Subscribe Button](#podlove-subscribe-button)auto - [Episodes](#episodes)auto - [Guests](#guests)auto - [Guest Pages](#guest-pages)auto - [Hosts](#hosts)auto - [Host Pages](#host-pages)auto - [Sponsors](#sponsors)autoauto + + +- [The config file](#the-config-file) + - [Top-level items](#top-level-items) + - [General Parameters](#general-parameters) + - [Feed Parameters](#feed-parameters) + - [Favicon parameters](#favicon-parameters) + - [Social Parameters](#social-parameters) + - [Host/Author Parameters](#hostauthor-parameters) + - [Host Social Parameters](#host-social-parameters) + - [Link Parameters](#link-parameters) + - [A note about `BaseURL`](#a-note-about-baseurl) + - [Pagination setting with grid layout](#pagination-setting-with-grid-layout) + - [Permalinks](#permalinks) + - [Menus](#menus) + - [Podlove Subscribe Button](#podlove-subscribe-button) +- [Episodes](#episodes) + - [Upcoming Episodes](#upcoming-episodes) +- [Guests](#guests) + - [Guest Pages](#guest-pages) +- [Hosts](#hosts) + - [Host Pages](#host-pages) +- [Sponsors](#sponsors) ## The config file @@ -256,6 +277,7 @@ podcast_bytes = "123456789" title = "Back to School" youtube = "" truncate = "" +upcoming = false +++ @@ -284,6 +306,15 @@ Graphical user interface influencer value proposition startup hackathon iPad ana | `truncate` | No | The number of characters to truncate the summary on the row layout.. The default value (if not set) is 600 characters. | "700" | | `guid` | No | A fixed, globally unique identifier for the episode which should never change. If one is not specified the URL of the `podcast_file` will be used instead. | "aae20190418" | | `transcript` | No | The path to the transcript file. The file can have Markdown or be in HTML. It must be relative to the root of your site (this is a file path, not a URL). It is recommended to put them in your `static` directory so that Hugo doesn't try to process them. | "/static/transcripts/chatops.txt" | +| `upcoming` | No | Boolean value if the episode should be considered "upcoming" and not published. Values include `true` or `false`. If set to `true`, the episode will not show up in episode lists (including guest and host pages) and will not be part of the feed. Upcoming episodes will be listed on the "Upcoming" page if created. | true | + +### Upcoming Episodes + +If you would like to display upcoming episodes, you need to do a couple things. First, you will need to create a page where the upcoming episodes will be listed. You can check out `exampleSite` for an example, but basically, you want to create `content/upcoming/_index.md`. + +Any episodes that have `upcoming` in their frontmatter set to `true` will be listed here, but not listed on any other pages (feed, home page, guest pages, etc). Additionally, episodes that are marked as "upcoming" will not display a YouTube video or audio player, even if those parameters are set. + +Note: you will need to set `buildFuture = true` in your `config.toml` to allow Hugo to build upcoming episodes that are dated in the future. ## Guests diff --git a/archetypes/episode.md b/archetypes/episode.md index 62553057..dea2478a 100644 --- a/archetypes/episode.md +++ b/archetypes/episode.md @@ -19,4 +19,5 @@ images = ["img/episode/default-social.jpg"] explicit = "no" # values are "yes" or "no" # media_override # if you want to use a specific URL for the audio file # truncate = "" +# upcoming = true # set to true if you want this to be listed as upcoming, etc, etc +++ diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 045ba591..631eabe6 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -5,6 +5,7 @@ theme = "castanet" googleAnalytics = "" themesdir = "../.." paginate = "9" +buildFuture = true [permalinks] @@ -36,6 +37,11 @@ paginate = "9" identifier = "guests" url = "/guest" +[[Menu.Main]] + name = "Upcoming Episodes" + identifier = "upcoming" + url = "/upcoming" + [[Menu.Main]] name = "Resources" identifier = "resources" diff --git a/exampleSite/content/episode/june.md b/exampleSite/content/episode/june.md index b8a23497..c8202d3d 100644 --- a/exampleSite/content/episode/june.md +++ b/exampleSite/content/episode/june.md @@ -16,7 +16,7 @@ podcast_bytes = "" tags = [] title = "School's Out For Summer" youtube = "" - +upcoming = false +++ Bootstrapping alpha seed money scrum project. Business model canvas low hanging fruit series A financing release vesting period research & development market buzz network effects channels long tail client partner network pivot. Innovator market android buyer gamification. User experience gamification interaction design sales. Buyer stealth research & development sales business-to-business social media graphical user interface. Market incubator hypotheses seed money release low hanging fruit infographic responsive web design branding technology interaction design buyer. Ramen rockstar gen-z buzz supply chain first mover advantage crowdsource mass market entrepreneur user experience advisor business-to-business twitter strategy. Termsheet low hanging fruit lean startup crowdfunding customer. Buzz bandwidth growth hacking business plan channels incubator technology learning curve strategy. Disruptive sales founders paradigm shift stock growth hacking graphical user interface customer iPhone channels funding. diff --git a/exampleSite/content/episode/sept.md b/exampleSite/content/episode/sept.md index e78149bf..363bbc94 100644 --- a/exampleSite/content/episode/sept.md +++ b/exampleSite/content/episode/sept.md @@ -3,12 +3,13 @@ Description = "Bootstrapping alpha seed money scrum project. Business model canv aliases = ["/12"] author = "Matt" categories = [] -date = "2016-09-25T04:10:01-05:00" +date = "2020-12-25T04:10:01-05:00" episode = "12" episode_image = "img/episode/sept.jpg" #episode_banner = "img/episode/default-banner.jpg" explicit = "no" guests = ["jsmith", "ccooper"] +hosts = ["mstratton","bkromhout"] sponsors = ["bluthcompany"] images = ["img/episode/default-social.jpg"] news_keywords = [] @@ -20,6 +21,7 @@ title = "Back to School" youtube = "" truncate = "" transcript = "/static/transcripts/chatops.txt" +upcoming = true +++ Graphical user interface influencer value proposition startup hackathon iPad analytics gen-z entrepreneur release traction product management long tail. Buzz business-to-consumer android learning curve innovator seed money iteration buyer startup. Holy grail graphical user interface responsive web design lean startup bandwidth strategy release innovator low hanging fruit non-disclosure agreement. Strategy handshake iPhone interaction design early adopters. Low hanging fruit crowdfunding vesting period. Low hanging fruit social proof series A financing product management founders bootstrapping ecosystem buyer supply chain hackathon direct mailing churn rate client. Scrum project direct mailing ecosystem monetization innovator. Partner network gen-z conversion pivot iPhone infographic growth hacking business plan facebook alpha marketing beta technology. Focus crowdsource venture strategy user experience. Lean startup disruptive user experience stealth interaction design monetization client long tail virality seed round direct mailing hypotheses technology burn rate. diff --git a/exampleSite/content/upcoming/_index.md b/exampleSite/content/upcoming/_index.md new file mode 100644 index 00000000..a1ba4e2b --- /dev/null +++ b/exampleSite/content/upcoming/_index.md @@ -0,0 +1,6 @@ ++++ +date = "2016-09-25T02:11:48-05:00" +description = "about this site" +title = "Upcoming Episodes" ++++ +these are episodes that aren't published yet diff --git a/layouts/episode/single.html b/layouts/episode/single.html index 55dca3b1..b1ba0584 100644 --- a/layouts/episode/single.html +++ b/layouts/episode/single.html @@ -3,7 +3,11 @@

{{ title .Title }}

- Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }} + {{- if ne $.Params.upcoming true -}} + Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }} + {{- else -}} + Scheduled for {{ dateFormat "Monday, Jan 2, 2006" .Date }} + {{- end -}}
@@ -44,23 +48,27 @@

{{ title .Title }}

{{ end }} {{- with .Params.podcast_file -}} -
-
+ {{- if ne $.Params.upcoming true -}} +
+
- + +
-
+ {{- end -}} {{- end -}} {{- with .Params.youtube -}} -
-
-
- + {{- if ne $.Params.upcoming true -}} +
+
+
+ +
-
+ {{- end -}} {{- end -}} diff --git a/layouts/guest/single.html b/layouts/guest/single.html index d5a7ab96..594811a3 100644 --- a/layouts/guest/single.html +++ b/layouts/guest/single.html @@ -105,7 +105,7 @@

Episodes Featuring {{ .Title }}

{{ range $name := ($.Scratch.Get "guest-names") }} {{- $.Scratch.Set "guest-name" $name -}} - {{- range $page := where $.Site.Pages "Type" "episode" -}} + {{- range $page := (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "!=" true ) -}} {{- range $page.Params.guests -}} {{- if eq . ($.Scratch.Get "guest-name") -}} {{$page.Title}} diff --git a/layouts/host/list.html b/layouts/host/list.html index c22776b4..936c6dc9 100644 --- a/layouts/host/list.html +++ b/layouts/host/list.html @@ -6,7 +6,7 @@

Hosts of {{ .Site.Title }}

{{ with .Content }} -
+
{{ . }}
diff --git a/layouts/host/single.html b/layouts/host/single.html index 9b7a8daf..5d3ea3f7 100644 --- a/layouts/host/single.html +++ b/layouts/host/single.html @@ -84,7 +84,7 @@

{{ title .Title }}

Episodes Hosted By {{ .Title }}

{{ $.Scratch.Set "host-name" .File.BaseFileName }} - {{ range $page := where $.Site.Pages "Type" "episode" }} + {{ range $page := (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "!=" true ) }} {{ range $page.Params.hosts }} {{ if eq . ($.Scratch.Get "host-name") }} {{$page.Title}} @@ -94,7 +94,7 @@

Episodes Hosted By {{ .Title }}

{{- with .Params.Aka -}} {{ range $name := . }} {{- $.Scratch.Set "host-name" $name -}} - {{- range $page := where $.Site.Pages "Type" "episode" -}} + {{- range $page := (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "!=" true ) -}} {{- range $page.Params.hosts -}} {{- if eq . ($.Scratch.Get "host-name") -}} {{$page.Title}} diff --git a/layouts/partials/grid-upcoming.html b/layouts/partials/grid-upcoming.html new file mode 100644 index 00000000..56700506 --- /dev/null +++ b/layouts/partials/grid-upcoming.html @@ -0,0 +1,117 @@ +
+ +
+

All Episodes

+
+ +
+ + {{ $paginator := .Paginate (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "==" true ) }} + + {{ range $paginator.Pages }} + {{ $.Scratch.Set "episode" .File.BaseFileName }} +
+ +
+

{{ title .Title }}

+ Scheduled for {{ dateFormat "Monday, Jan 2, 2006" .Date }} +
+ +
+ {{ end }} + + +
+ +
+{{ if gt $paginator.TotalPages 1 }} +
+
+ + + +
+
+{{ end }} +
+
diff --git a/layouts/partials/grid.html b/layouts/partials/grid.html index dde091f0..cec0ac7a 100644 --- a/layouts/partials/grid.html +++ b/layouts/partials/grid.html @@ -8,7 +8,8 @@

All Episodes

- {{ $paginator := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }} + {{ $paginator := .Paginate (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "!=" true ) }} + {{ range $paginator.Pages }} {{ $.Scratch.Set "episode" .File.BaseFileName }}
diff --git a/layouts/partials/row-upcoming.html b/layouts/partials/row-upcoming.html new file mode 100644 index 00000000..60d99182 --- /dev/null +++ b/layouts/partials/row-upcoming.html @@ -0,0 +1,166 @@ +
+ +{{- if (where site.RegularPages "Type" "in" site.Params.mainSections) -}} +{{- $paginator := .Paginate (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "==" true ) }} +{{- $list := (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "==" true ) -}} +{{- $len := (len $list) -}} +
+{{- with .Site.Params.enable_jumbo -}} + {{- if eq . "true" -}} +
+ {{- else -}} +
+ {{- end -}} +{{- else -}} +
+{{- end -}} + {{- range $paginator.Pages -}} + {{- with .Params.truncate -}} + {{- $.Scratch.Set "truncate" . }} + {{- else -}} + {{- with .Site.Params.truncate -}} + {{- $.Scratch.Set "truncate" . }} + {{- else -}} + {{- $.Scratch.Set "truncate" 600 -}} + {{- end -}} + {{- end -}} +
+
+

{{ .Title }}

+ Scheduled for {{ dateFormat "Monday, Jan 2, 2006" .Date }} +
+
+
+ {{- if .Params.episode_image -}} +
+ +
+
+ {{- if ge (countrunes .Description ) ($.Scratch.Get "truncate") -}} +

{{ .Description | markdownify | truncate ($.Scratch.Get "truncate") " "}} Read More

+ {{- else -}} +

{{ .Description | markdownify }}

+ {{- end -}} +
+ {{- else -}} +
+ {{- if ge (countrunes .Description ) ($.Scratch.Get "truncate") -}} +

{{ .Description | markdownify | truncate ($.Scratch.Get "truncate") " "}} Read More

+ {{- else -}} +

{{ .Description | markdownify }}

+ {{- end -}} +
+ {{- end -}} +
+ {{- with .Params.podcast_file -}} +
+
+
+
+ {{- end -}} + + {{- end -}} +
+ + +{{- if isset .Site.Params "enable_jumbo" -}} + {{- if ne .Site.Params.enable_jumbo "true" -}} + + {{- end -}} +{{- else -}} + +{{- end -}} + +
+
+
+{{- if gt $paginator.TotalPages 1 -}} +
+
+ + + +
+
+{{- end -}} +
+{{- end -}} +
+
diff --git a/layouts/partials/row.html b/layouts/partials/row.html index c7544362..3c8389c1 100644 --- a/layouts/partials/row.html +++ b/layouts/partials/row.html @@ -10,7 +10,7 @@

Latest Episode

- {{ range first 1 (where site.RegularPages "Type" "in" site.Params.mainSections) }} + {{ range first 1 (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "!=" true ) }} {{- with .Params.truncate -}} {{- $.Scratch.Set "truncate" . }} {{- else -}} @@ -112,8 +112,8 @@

{{- if (where site.RegularPages "Type" "in" site.Params.mainSections) -}} -{{- $paginator := .Paginate (after 1 (where site.RegularPages "Type" "in" site.Params.mainSections)) }} -{{- $list := (where site.RegularPages "Type" "in" site.Params.mainSections) -}} +{{- $paginator := .Paginate (after 1 (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "!=" true )) }} +{{- $list := (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "!=" true ) -}} {{- $len := (len $list) -}}
{{- with .Site.Params.enable_jumbo -}} diff --git a/layouts/partials/upcoming.html b/layouts/partials/upcoming.html new file mode 100644 index 00000000..5b660cf5 --- /dev/null +++ b/layouts/partials/upcoming.html @@ -0,0 +1,9 @@ +{{ if isset $.Site.Params "site_layout" }} + {{ if eq $.Site.Params.site_layout "grid" }} + {{- partial "grid-upcoming.html" . }} + {{ else }} + {{- partial "row-upcoming.html" . }} + {{ end }} +{{ else }} + {{- partial "row-upcoming.html" . }} +{{ end }} \ No newline at end of file diff --git a/layouts/section/episode.rss.xml b/layouts/section/episode.rss.xml index ca9944ac..5354b7f6 100644 --- a/layouts/section/episode.rss.xml +++ b/layouts/section/episode.rss.xml @@ -50,7 +50,7 @@ {{ .Site.Params.feed.explicit }} {{- end -}} Hugo -- gohugo.io - {{- range (where .Site.Pages "Type" "episode") -}} + {{- range (where ( where .Site.Pages "Type" "episode") ".Params.upcoming" "!=" true) -}} {{ if isset .Params "podcast_file" }} {{ title .Title }} diff --git a/layouts/upcoming/list.html b/layouts/upcoming/list.html new file mode 100644 index 00000000..2c3bd32b --- /dev/null +++ b/layouts/upcoming/list.html @@ -0,0 +1,18 @@ +{{ define "main" }} + +
+
+

Upcoming Episodes

+
+
+{{ with .Content }} +
+
+ {{ . }} +
+
+{{- end -}} + +{{ partial "upcoming.html" . }} + +{{ end }} \ No newline at end of file