From 27d94f483968194ec95068bb07b0b1213841d1cd Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sun, 4 Oct 2020 16:19:33 +0100 Subject: [PATCH 1/2] Add customisable config for Youtube playlists. --- config.toml.example | 16 +++++++++++++++- public/js/index.js | 25 ++++++++++++++++--------- structs/config.go | 30 ++++++++++++++++++++++-------- views/cin.tmpl | 3 +-- views/index.tmpl | 16 ++++++++++------ views/on_demand.tmpl | 30 +++++++++++++++++++++++------- 6 files changed, 87 insertions(+), 33 deletions(-) diff --git a/config.toml.example b/config.toml.example index 8e46dd9c..f4c084a1 100644 --- a/config.toml.example +++ b/config.toml.example @@ -48,7 +48,21 @@ [pageContext.youtube] APIKey = "AIzaSyCzI5Gvpq1hPlfjvB81EVc0vLv_11eW7NI" - sessionsPlaylistID = "PLsxUDJzU4VKDudlmlYb-ImFKreFKAfFln" + homepagePlaylistID = "PLsxUDJzU4VKDag-NVag4kMN1i5C7ZyP85" + homepageDescription = "Fresh music from fresh artists, something witty here..." + homepageTitle = "Q-Fest" + homepageBGColour = "#235660" + homepageColor = "#fff" + od1PlaylistID = "PLsxUDJzU4VKDudlmlYb-ImFKreFKAfFln" + od1Description = "Fresh music from fresh artists, something witty here..." + od1Title = "URY Sessions" + od1BGColor = "#53306a" + od1Color = "#fff" + od2PlaylistID = "PLsxUDJzU4VKDag-NVag4kMN1i5C7ZyP85" + od2Description = "Fresh music from fresh artists, something witty here..." + od2Title = "Q-Fest" + od2BGColor = "#235660" + od2Color = "#fff" cinPlaylistID = "PLsxUDJzU4VKAAH1pOogbzJx7pZgd-2zOx" channelURL = "//youtube.com/ury1350" diff --git a/public/js/index.js b/public/js/index.js index c1d08b2b..bc3a6a64 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -31,7 +31,7 @@ function getYoutubeFeed(playlistid, results, htmlid) { "" ); } - if (isIndex && htmlid === "#sessions-videos") { + if (htmlid === "#homepage-videos") { $(htmlid).append( '
' + "" + @@ -42,7 +42,7 @@ function getYoutubeFeed(playlistid, results, htmlid) { "
" ); } - if (isOD && htmlid === "#sessions-videos") { + if (isOD && htmlid !== "#cin-videos") { $(htmlid).append( '
' + '" ); } - if (isCIN && htmlid === "#cin-videos") { + if (!isCIN && htmlid === "#cin-videos") { $(htmlid).append( '
' + '