From b8cadb56667fa6b63fdddaf9ef175a69ec35dad0 Mon Sep 17 00:00:00 2001 From: fallow64 Date: Tue, 29 Jul 2025 15:36:03 -0500 Subject: [PATCH 1/5] Add presentation pages --- .gitmodules | 3 +++ _config.yml | 7 +++++ _layouts/presentation.html | 52 ++++++++++++++++++++++++++++++++++++++ _presentations | 1 + assets/js/scripts.js | 27 ++++++++++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 _layouts/presentation.html create mode 160000 _presentations diff --git a/.gitmodules b/.gitmodules index 52af485c..1c4d1121 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "_events_external"] path = _events url = https://github.com/CHTC/events +[submodule "_presentations"] + path = _presentations + url = https://github.com/CHTC/Presentations.git diff --git a/_config.yml b/_config.yml index ea027f75..ddd15aef 100755 --- a/_config.yml +++ b/_config.yml @@ -60,6 +60,9 @@ collections: redirects: output: true permalink: /:path + presentations: + output: true + permalink: /presentations/:year/:month/:day/:title/ defaults: - scope: @@ -97,6 +100,10 @@ defaults: type: redirects values: layout: redirect + - scope: + type: presentations + values: + layout: presentation diff --git a/_layouts/presentation.html b/_layouts/presentation.html new file mode 100644 index 00000000..4a49a1d3 --- /dev/null +++ b/_layouts/presentation.html @@ -0,0 +1,52 @@ +--- +layout: container-default +--- + +{% assign date = page.date | date: "%B %e" %} + +
+
+
+
+

+ {{ page.title }} +

+
+ +
+
+ +
+
+ +
+

{{ page.presenter }} at {{ page.event }}

+

{{ date }}

+
+ +

+ {{ page.description | markdownify }} +

+ +
+ {% for tag in page.keywords %} + {{ tag }} + {% endfor %} +
+ + +

Associated Links

+ +
+
+
diff --git a/_presentations b/_presentations new file mode 160000 index 00000000..40d60c48 --- /dev/null +++ b/_presentations @@ -0,0 +1 @@ +Subproject commit 40d60c48066c5428c19fe97ed7113c7ca121d8ad diff --git a/assets/js/scripts.js b/assets/js/scripts.js index e69de29b..22e0daeb 100644 --- a/assets/js/scripts.js +++ b/assets/js/scripts.js @@ -0,0 +1,27 @@ +function generateStringHash(value) { + // Simple hash function to generate a number from the tag string + let hash = 0; + for (let i = 0; i < value.length; i++) { + hash = value.charCodeAt(i) + ((hash << 5) - hash); + } + + return hash; +} + +document.addEventListener("DOMContentLoaded", () => { + function fillBadgeColors() { + const badges = document.querySelectorAll(".tag-badge"); + badges.forEach(badge => { + const tagText = badge.textContent.trim(); + let hue = generateStringHash(tagText) % 360; + if (hue >= 60 && hue <= 140) { + hue = (hue + 80) % 360; // avoid ugly colors + } + + badge.style.backgroundColor = `hsl(${hue}, 70%, 40%)`; + badge.style.color = "#fff"; + }); + } + + fillBadgeColors(); +}); \ No newline at end of file From f022d432bf0866505778d323fb45e1ed841f38f8 Mon Sep 17 00:00:00 2001 From: fallow64 Date: Tue, 29 Jul 2025 15:58:14 -0500 Subject: [PATCH 2/5] Add presentation list page --- _includes/get/presentations.liquid | 1 + _includes/layout/header.html | 1 + presentations.html | 38 ++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 _includes/get/presentations.liquid create mode 100644 presentations.html diff --git a/_includes/get/presentations.liquid b/_includes/get/presentations.liquid new file mode 100644 index 00000000..19ed0664 --- /dev/null +++ b/_includes/get/presentations.liquid @@ -0,0 +1 @@ +{% assign presentations = site.presentations | where_exp: "presentation", "presentation.publish_on contains site.key" %} diff --git a/_includes/layout/header.html b/_includes/layout/header.html index 573323df..97804680 100644 --- a/_includes/layout/header.html +++ b/_includes/layout/header.html @@ -38,6 +38,7 @@ Spotlights Events News + Presentations