From a226b45bc0e9c43ed97366e3fb7e9d2649d413a7 Mon Sep 17 00:00:00 2001 From: rra Date: Thu, 15 Sep 2022 08:34:52 +0200 Subject: [PATCH 1/7] new header & menu layout by Cristoph --- config.toml | 7 + .../layouts/partials/header.html | 59 +-- themes/lumbung-theme/static/css/main.css | 368 ++++++++++++++---- themes/lumbung-theme/static/img/black-dot.svg | 16 + themes/lumbung-theme/static/img/logo.svg | 36 +- .../static/js/hugotagsfilter-1.2.2.min.js | 221 +++++++++++ 6 files changed, 577 insertions(+), 130 deletions(-) create mode 100644 themes/lumbung-theme/static/img/black-dot.svg create mode 100644 themes/lumbung-theme/static/js/hugotagsfilter-1.2.2.min.js diff --git a/config.toml b/config.toml index 826c181..44eadc6 100644 --- a/config.toml +++ b/config.toml @@ -3,6 +3,8 @@ languageCode = "en-gb" title = "lumbung.space" theme = "lumbung-theme" pluralizeListTitles = "false" +paginate = 20 + [params] logo = "/img/logo.svg" @@ -10,6 +12,9 @@ pluralizeListTitles = "false" description = 'a digital living room for the lumbung ekosistem' images = ['/img/logo.png'] title = 'lumbung dot space' + bundleCss = "/bundle.css" + bundleJs = "/bundle.js" + mainSections = ['social', 'shouts', 'calendar', 'tv', 'pen'] [markup.goldmark.renderer] unsafe = true @@ -22,3 +27,5 @@ unsafe = true [permalinks] timelines = "/timeline/:slug/" + + diff --git a/themes/lumbung-theme/layouts/partials/header.html b/themes/lumbung-theme/layouts/partials/header.html index 41f0da3..24a721d 100644 --- a/themes/lumbung-theme/layouts/partials/header.html +++ b/themes/lumbung-theme/layouts/partials/header.html @@ -1,24 +1,15 @@
-
- - login + - - - - - +
+ diff --git a/themes/lumbung-theme/static/css/main.css b/themes/lumbung-theme/static/css/main.css index 7c517d9..c2a807e 100644 --- a/themes/lumbung-theme/static/css/main.css +++ b/themes/lumbung-theme/static/css/main.css @@ -73,9 +73,14 @@ body > iframe { box-sizing: border-box; } +a { + color: #000; +} + .container { margin: 2em auto; max-width: 80%; + width: 100%; margin-bottom: 0; } @@ -159,37 +164,128 @@ body > iframe { /* base header & menu */ -#top-menu { - padding: 1.5rem 1rem 0; - display: grid; - grid-template-columns: 300px 1fr auto; - align-items: flex-start; +.header-row { + margin: 1.5rem; + display: flex; + justify-content: space-between; + align-items: center; } .home-link { - text-decoration: none; + display: block; + max-width: 700px; + width: 70%; + padding: 0; } .logo { - width: 283px; - margin-top: 2rem; + display: block; + width: 100%; + height: auto; } -#top-menu a { +#top-menu .login-link { + background: #009d9b; + padding: 5px 30px; + color: #fff; + font-weight: 900; +} + +.menu-row { + margin: 0 auto; + max-width: 80%; + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + position: sticky; + top: 15px; + z-index: 99; +} + +.filter-link { + background: #333; + height: 100%; + display: flex; + align-items: center; + padding: 0 30px; + color: #fff; + cursor: pointer; +} + +.filter-icon { + height: 14px; + width: auto; + display: block; + margin-right: 10px; +} + +.filter-icon path { + fill:#fff; +} + +.mobile-menu-button { + width: 35px; + height: 16px; + display: none; + flex-direction: column; + justify-content: space-between; + color: pointer; +} + +.mobile-menu-button--line { + width: 100%; + height: 2px; + background: #333; +} + +.menu { + border: 2px solid #000; + padding: 0 1rem; + display: flex; + align-items: center; + background: #fff; +} + +.menu-dot { + width: 10px; + height: 10px; + margin-right: 3rem; +} + +.menu ul { + list-style-type: none; + margin: 0 auto; + padding-left: 0; + display: flex; + justify-content: space-between; + text-transform: lowercase; +} + +.menu ul li { + margin-right: 1.5rem; + padding: 0.5rem 0; +} + +.menu ul li:last-child { + margin-right: 0; +} + +.menu-nav-item { + border-right: 2px solid var(--border-color); + padding: 0.5em; +} + +.menu a { text-decoration: none; color: #333; } -#top-menu a:hover, -#top-menu a:focus { +.menu a:hover, +.menu a:focus { color: black; } -#top-menu #login { - font-weight: bold; - margin-top: 8px; -} - #top-menu div { display: flex; } @@ -199,7 +295,7 @@ body > iframe { display: none; } -#top-menu input { +.menu input { border: none; border-bottom: 1px solid #333; margin-right: 2rem; @@ -207,8 +303,8 @@ body > iframe { margin-left: 5px; } -#top-menu input:focus, -#top-menu input:hover { +.menu input:focus, +.menu input:hover { outline: none; border-bottom: 1px solid #333; } @@ -222,27 +318,8 @@ body > iframe { display: none; } -.menu { - margin-top: 8px; -} - -.menu ul { - list-style-type: none; - margin: 0 auto; - padding-left: 3rem; - display: flex; - justify-content: space-between; - text-transform: lowercase; - max-width: 1100px; -} - -.menu-nav-item { - border-right: 2px solid var(--border-color); - padding: 0.5em; -} - /* styles for "tools" dropdown menu */ -#top-menu ul.submenu { +.menu ul.submenu { flex-direction: column; margin-left: 0; position: absolute; @@ -257,6 +334,7 @@ body > iframe { .menu .submenu li { margin: 2px 0; + padding: 0; } .menu .has-submenu { @@ -272,49 +350,41 @@ body > iframe { visibility: visible; } -#top-menu .menu ul.submenu { - margin-left: 11px; - margin-top: 10px; - border: 1px solid ; +.menu ul.submenu { + margin-left: -0.5em; + margin-top: 8px; + border: 2px solid ; gap: 0.25em; padding: 0.5em; } -#top-menu a { +.menu a { padding: 0 5px; } -#top-menu .menu .submenu a { +.menu .menu .submenu a { margin: 0; display: flex; } -#top-menu .drawer .submenu { +.menu .drawer .submenu { position: initial; display: none; } -#top-menu .drawer .submenu.opened { +.menu .drawer .submenu.opened { display: flex; } -#top-menu .drawer .submenu li { +.menu .drawer .submenu li { padding: 0; padding-top: 1em; } -#top-menu .drawer .opened .submenu { +.menu .drawer .opened .submenu { visibility: visible; } -.drawer .has-submenu { - padding-left: 1em; - margin-left: 5px; - color: #333; - display: flex; - flex-direction: column; -} - /*Article Summary Cards*/ @@ -495,16 +565,15 @@ div.network-source { right: 1em; } -.network-source::before { - content: ""; +.network-source .triangle { position: absolute; - right: -20px; + right: 0px; bottom: 0; - width: 0; - height: 0; - border-left: 20px solid var(--shouts-dark); - border-top: 23px solid transparent; - border-bottom: 23px solid transparent; + width: auto; + height: calc(100% + 0.5px); + top: -0.5px; + transform: translateX(calc(100% - 0.5px)); + fill: var(--shouts-dark); } .network-source a { @@ -1011,6 +1080,117 @@ li.page-item:after { z-index: -100; } + +/* FILTER */ + +.filter-item, .card, .video-box { + display: none; +} + +.show-item { + display: block !important; +} + +.filter-buttons-container { + display: none; + background: #fff; + padding: 1.5rem; + border: 2px solid; + position: absolute; + top: 44px; + z-index: 99; + width: 100%; + overflow: hidden; +} + +.filter-buttons-container-header { + display: flex; + margin-bottom: 20px; +} + +.load-all { + margin-left: 30px; + cursor: pointer; + text-decoration: underline; + color: #333; +} + +@media (min-width: 980px) { + .filter-link:hover + .filter-buttons-container { + display: block; + } + + .filter-buttons-container:hover { + display: block; + } +} + +.filter-buttons { + width: 100%; + margin-bottom: 10px; + display: flex; + white-space: nowrap; + overflow: scroll; + -ms-overflow-style: none; + scrollbar-width: none; +} + +.filter-buttons button { + display: block; + border: 0; + background: unset; + border-radius: 0; + width: fit-content; + cursor: pointer; + background: #009d9b; + margin-right: 5px; + white-space: nowrap; + color: #fff; + padding: 0.8rem; + text-transform: lowercase; +} + +.filter-buttons .filter-button.active { + background: #f04b1e; +} + +.filter-buttons .filter-button.active:after { + content:"\00d7"; + display: inline-block; + margin-left: 5px; +} + + .disable-button { + display: none !important; + } + + .page-nav { + display: flex; + justify-content: center; + margin: 20px auto 50px; + } + + .nextpage { + padding: 15px; + position: relative; + color: #333; + text-decoration: none; + margin: 0px 20px; + font-size: 38px; + } + + .nextpage:after { + content: ""; + height: 50%; + width: 100%; + display: block; + border: 2px solid #333; + border-top: 0; + bottom: 0; + position: absolute; + left: 0; + } + /* Landingpage */ .welcome-text { text-align: center; @@ -1566,14 +1746,66 @@ a.timeline-url { } /* menu styles */ + + .mobile-menu-button { + display: flex; + } + + + .menu-row, #top-menu { + position: fixed !important; + z-index: 97; + } + + .menu-row { + z-index: 98; + width: fit-content; + margin-top: 3vw; + right: 5%; + } + + .filter-buttons-container { + position: fixed; + top: 90px; + z-index: 99; + width: 90%; + overflow: hidden; + left: 5%; + } + + .filter-buttons-container.open { + display: block !important; + } + + .container { + padding-top: 60px; + } + + .filter-link { + background: unset; + padding: 0; + } + + .filter-link span { + display: none; + } + + .filter-icon { + height: 20px; + margin-right: 24px; + } + + .filter-icon path { + fill: #333; + } + #top-menu div.mobile-menu { display: flex; justify-content: space-between; } - .mobile-menu #login { - display: inline-flex; - margin: 0 0 0 auto; + #top-menu .login-link { + display: none; } .hamburger { diff --git a/themes/lumbung-theme/static/img/black-dot.svg b/themes/lumbung-theme/static/img/black-dot.svg new file mode 100644 index 0000000..1cae633 --- /dev/null +++ b/themes/lumbung-theme/static/img/black-dot.svg @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/themes/lumbung-theme/static/img/logo.svg b/themes/lumbung-theme/static/img/logo.svg index 9409ee3..c60c548 100644 --- a/themes/lumbung-theme/static/img/logo.svg +++ b/themes/lumbung-theme/static/img/logo.svg @@ -1,21 +1,17 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/themes/lumbung-theme/static/js/hugotagsfilter-1.2.2.min.js b/themes/lumbung-theme/static/js/hugotagsfilter-1.2.2.min.js new file mode 100644 index 0000000..e89770b --- /dev/null +++ b/themes/lumbung-theme/static/js/hugotagsfilter-1.2.2.min.js @@ -0,0 +1,221 @@ +!(function l(r, a, o) { + function h(e, t) { + if (!a[e]) { + if (!r[e]) { + var s = "function" == typeof require && require; + if (!t && s) return s(e, !0); + if (u) return u(e, !0); + var i = new Error("Cannot find module '" + e + "'"); + throw ((i.code = "MODULE_NOT_FOUND"), i); + } + var n = (a[e] = { exports: {} }); + r[e][0].call( + n.exports, + function (t) { + return h(r[e][1][t] || t); + }, + n, + n.exports, + l, + r, + a, + o + ); + } + return a[e].exports; + } + for (var u = "function" == typeof require && require, t = 0; t < o.length; t++) h(o[t]); + return h; +})( + { + 1: [ + function (t, e, s) { + "use strict"; + var i = (function () { + function i(t, e) { + for (var s = 0; s < e.length; s++) { + var i = e[s]; + (i.enumerable = i.enumerable || !1), (i.configurable = !0), "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i); + } + } + return function (t, e, s) { + return e && i(t.prototype, e), s && i(t, s), t; + }; + })(); + /** + * @name 'Hugo Tags Filter' + * @version 1.2.2 + * @license MIT + * @author PointyFar + */ + var n = (function () { + function l(t) { + !(function (t, e) { + if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); + })(this, l); + (this.FILTERS = + t && t.filters + ? t.filters + : [ + { name: "tag", prefix: "tft-", buttonClass: "tft-button", allSelector: "#tfSelectAllTags", attrName: "data-tags" }, + { name: "section", prefix: "tfs-", buttonClass: "tfs-button", allSelector: "#tfSelectAllSections", attrName: "data-section" }, + ]), + (this.showItemClass = t && t.showItemClass ? t.showItemClass : "tf-show"), + (this.activeButtonClass = t && t.activeButtonClass ? t.activeButtonClass : "active"), + (this.filterItemClass = t && t.filterItemClass ? t.filterItemClass : "tf-filter-item"), + (this.counterSelector = t && t.counterSelector ? t.counterSelector : "selectedItemCount"), + (this.populateCount = !(!t || !t.populateCount) && t.populateCount), + (this.setDisabledButtonClass = !(!t || !t.setDisabledButtonClass) && t.setDisabledButtonClass), + (this.filterItems = document.getElementsByClassName(this.filterItemClass)), + (this.selectedItemCount = 0), + (this.filterValues = {}); + for (var e = 0; e < this.FILTERS.length; e++) { + (this.FILTERS[e].buttonTotal = document.getElementsByClassName(this.FILTERS[e].buttonClass).length), (this.FILTERS[e].selected = []), (this.FILTERS[e].values = []); + var s = document.getElementsByClassName(this.FILTERS[e].buttonClass); + this.filterValues[this.FILTERS[e].name] = []; + for (var i = 0; i < s.length; i++) { + var n = s[i].id.replace(this.FILTERS[e].prefix, ""); + this.filterValues[this.FILTERS[e].name][n] = { count: 0, selected: 0 }; + } + } + this.showCheck(this.FILTERS[0].name, !0); + } + return ( + i(l, [ + { + key: "initFilterCount", + value: function (t, e) { + if (e) for (var s in t) for (var i = 0; i < this.filterItems.length; i++) for (var n = this.getAttrs(s, this.filterItems[i]), l = 0; l < n.length; l++) t[s][n[l]].count++, t[s][n[l]].selected++; + else { + var r = document.getElementsByClassName(this.showItemClass); + for (var s in t) for (var a in t[s]) t[s][a].selected = 0; + for (l = 0; l < r.length; l++) + for (s in t) { + n = this.getAttrs(s, r[l]); + for (var o = 0; o < n.length; o++) t[s][n[o]].selected++; + } + } + return t; + }, + }, + { + key: "populateCounters", + value: function (t) { + if (this.populateCount) + for (var e = 0; e < this.FILTERS.length; e++) { + var s = this.FILTERS[e].name, + i = this.FILTERS[e].countPrefix, + n = this.FILTERS[e].selectedPrefix; + if (i || n) + for (var l in t[s]) { + if (i) document.getElementById("" + i + l).textContent = t[s][l].count; + if (n) { + var r = document.getElementById("" + n + l); + (r.textContent = t[s][l].selected), + this.setDisabledButtonClass && + (0 == r.textContent + ? this.addClassIfMissing(document.getElementById(this.FILTERS[e].prefix + l), this.setDisabledButtonClass) + : this.delClassIfPresent(document.getElementById(this.FILTERS[e].prefix + l), this.setDisabledButtonClass)); + } + } + } + }, + }, + { + key: "getAttrs", + value: function (t, e) { + return e + .getAttribute("data-" + t) + .split(" ") + .filter(function (t) { + return 0 < t.length; + }); + }, + }, + { + key: "showAll", + value: function (t) { + for (var e = 0; e < this.FILTERS.length; e++) t ? this.FILTERS[e].name === t && (this.FILTERS[e].selected = []) : (this.FILTERS[e].selected = []); + this.showCheck(t); + }, + }, + { + key: "checkFilter", + value: function (t, e) { + for (var s = document.querySelector("#" + e + t), i = 0; i < this.FILTERS.length; i++) + this.FILTERS[i].prefix === e && + (0 <= this.FILTERS[i].selected.indexOf(t) + ? (this.FILTERS[i].selected.splice(t, 1), this.delClassIfPresent(s, this.activeButtonClass)) + : (this.FILTERS[i].selected.push(t), this.addClassIfMissing(s, this.activeButtonClass)), + this.delClassIfPresent(document.querySelector(this.FILTERS[i].allSelector), this.activeButtonClass), + this.showCheck(this.FILTERS[i].name)); + }, + }, + { + key: "showCheck", + value: function (t, e) { + for (var s = 0; s < this.FILTERS.length; s++) + if (this.FILTERS[s].name === t && (0 === this.FILTERS[s].selected.length || this.FILTERS[s].selected.length === this.FILTERS[s].buttonTotal)) { + for (var i = document.getElementsByClassName(this.FILTERS[s].buttonClass), n = 0; n < i.length; n++) this.delClassIfPresent(i[n], this.activeButtonClass); + this.addClassIfMissing(document.querySelector(this.FILTERS[s].allSelector), this.activeButtonClass); + } + for (s = this.selectedItemCount = 0; s < this.filterItems.length; s++) { + this.delClassIfPresent(this.filterItems[s], this.showItemClass); + var l = 0; + for (n = 0; n < this.FILTERS.length; n++) this.checkVisibility(this.FILTERS[n].selected, this.filterItems[s].getAttribute(this.FILTERS[n].attrName)) && l++; + l === this.FILTERS.length && (this.filterItems[s].classList.contains(this.showItemClass) || (this.selectedItemCount++, this.addClassIfMissing(this.filterItems[s], this.showItemClass))); + } + document.getElementById(this.counterSelector) && (document.getElementById(this.counterSelector).textContent = "" + this.selectedItemCount), this.checkButtonCounts(e); + }, + }, + { + key: "checkButtonCounts", + value: function (t) { + (this.filterValues = this.initFilterCount(this.filterValues, t)), this.populateCounters(this.filterValues); + }, + }, + { + key: "checkVisibility", + value: function (t, e) { + if (0 < t.length) { + for (var s = 0; s < t.length; s++) { + if ( + 0 <= + e + .split(" ") + .filter(function (t) { + return 0 < t.length; + }) + .indexOf(t[s]) + ) + return !0; + } + return !1; + } + return !0; + }, + }, + { + key: "addClassIfMissing", + value: function (t, e) { + t.classList.contains(e) || t.classList.add(e); + }, + }, + { + key: "delClassIfPresent", + value: function (t, e) { + t.classList.contains(e) && t.classList.remove(e); + }, + }, + ]), + l + ); + })(); + window.HugoTagsFilter = n; + }, + {}, + ], + }, + {}, + [1] +); From 475a614959c4ed80a2d6aaa2586c09346853a49e Mon Sep 17 00:00:00 2001 From: rra Date: Thu, 15 Sep 2022 18:39:33 +0200 Subject: [PATCH 2/7] change header & major rework of taxonomies as part of frontpage redesign --- config.toml | 3 +- .../{contributors.md => ls-contributors.md} | 0 .../layouts/_default/baseof.html | 10 - .../lumbung-theme/layouts/_default/list.html | 54 ++-- themes/lumbung-theme/layouts/index.html | 44 +-- themes/lumbung-theme/layouts/page/filter.html | 262 ++++++++++++++++++ .../layouts/partials/book_card.html | 39 +++ .../layouts/partials/filter-nav.html | 121 ++++++++ .../layouts/partials/header.html | 12 +- .../layouts/partials/network_card.html | 47 ---- .../layouts/partials/pen_card.html | 2 +- .../layouts/partials/shout_card.html | 91 +++--- .../layouts/partials/social_card.html | 49 ++++ themes/lumbung-theme/static/css/main.css | 85 +++--- 14 files changed, 618 insertions(+), 201 deletions(-) rename content/{contributors.md => ls-contributors.md} (100%) create mode 100644 themes/lumbung-theme/layouts/page/filter.html create mode 100644 themes/lumbung-theme/layouts/partials/book_card.html create mode 100644 themes/lumbung-theme/layouts/partials/filter-nav.html delete mode 100644 themes/lumbung-theme/layouts/partials/network_card.html create mode 100644 themes/lumbung-theme/layouts/partials/social_card.html diff --git a/config.toml b/config.toml index 44eadc6..1e59e82 100644 --- a/config.toml +++ b/config.toml @@ -21,8 +21,9 @@ unsafe = true [taxonomies] author = "authors" + contributor = "contributors" tag = "tags" - category = "categories" + source = "sources" timeline = "timelines" [permalinks] diff --git a/content/contributors.md b/content/ls-contributors.md similarity index 100% rename from content/contributors.md rename to content/ls-contributors.md diff --git a/themes/lumbung-theme/layouts/_default/baseof.html b/themes/lumbung-theme/layouts/_default/baseof.html index 638faaa..9e34d4e 100644 --- a/themes/lumbung-theme/layouts/_default/baseof.html +++ b/themes/lumbung-theme/layouts/_default/baseof.html @@ -41,16 +41,6 @@ }) }) - // add classes for styling lumbung kios and lumbung gallery cards - let cards = document.querySelectorAll('.shout.card'); - [...cards].forEach(card => { - if (card.querySelector('a[href="/tags/lumbungkios"]') || card.querySelector('a[href="/tags/lumbungkiosproducts"]')) { - card.classList.add('lumbung-kios') - } else if (card.querySelector('a[href="/tags/lumbunggallery"]')) { - card.classList.add('lumbung-gallery') - } - }) - // footer random color var color = ['orange','green','blue']; var footer = document.getElementById("footer"); diff --git a/themes/lumbung-theme/layouts/_default/list.html b/themes/lumbung-theme/layouts/_default/list.html index e93d0c7..3c45a28 100644 --- a/themes/lumbung-theme/layouts/_default/list.html +++ b/themes/lumbung-theme/layouts/_default/list.html @@ -4,40 +4,32 @@
{{ range where (.Paginator 13).Pages "Params.hidden" "ne" "true" }} - {{ if in .Params.categories "tv"}} - + {{if eq .Section "tv"}} {{- partial "video_box.html" . -}} - - {{ else if in .Params.categories "calendar" }} - - {{- partial "calendar_card.html" . -}} - - {{ else if in .Params.categories "network" }} - - {{- partial "network_card.html" . -}} - - {{ else if in .Params.categories "shouts" }} - - {{- partial "shout_card.html" . -}} - - {{ else if in .Params.categories "pen" }} - - {{- partial "pen_card.html" . -}} - - {{ else if in .Params.categories "book" }} - - {{- partial "book.html" . -}} - - {{ else if in .Params.categories "page" }} - - {{- partial "blank.html" . -}} - + + {{ else if eq .Section "events" }} + {{- partial "partials/calendar_card.html" . -}} + + {{ else if eq .Section "shouts" }} + {{ if in .Params.sources "pen.lumbung.space" }} + {{- partial "pen_card.html" . -}} + {{ else }} + {{- partial "shout_card.html" . -}} + {{ end }} + + {{ else if eq .Section "social" }} + {{- partial "social_card.html" . -}} + + {{ else if eq .Section "publications"}} + {{- partial "book_card.html" . -}} + + {{ else if eq .Section "sounds"}} + {{- partial "sounds_card.html" . -}} + {{ else }} - {{- partial "card.html" . -}} - - {{ end }} - + + {{ end }} {{ end }}
diff --git a/themes/lumbung-theme/layouts/index.html b/themes/lumbung-theme/layouts/index.html index 0f9408f..a5c69ec 100644 --- a/themes/lumbung-theme/layouts/index.html +++ b/themes/lumbung-theme/layouts/index.html @@ -6,22 +6,34 @@ {{ .Key }} {{ range .Pages }} - {{ if in .Params.categories "tv"}} - {{- partial "video_box.html" . -}} - {{ else if in .Params.categories "calendar" }} - {{- partial "calendar_card.html" . -}} - {{ else if in .Params.categories "network" }} - {{- partial "network_card.html" . -}} - {{ else if in .Params.categories "pen" }} - {{- partial "pen_card.html" . -}} - {{ else if in .Params.categories "shouts" }} - {{- partial "shout_card.html" . -}} - {{ else if in .Params.categories "books.lumbung.space"}} - {{- partial "book_card.html" . -}} - {{ else }} - {{- partial "card.html" . -}} - {{ end }} - {{ end }} + + {{if eq .Section "tv"}} + {{- partial "video_box.html" . -}} + + {{ else if eq .Section "events" }} + {{- partial "partials/calendar_card.html" . -}} + + {{ else if eq .Section "shouts" }} + {{ if in .Params.sources "pen.lumbung.space" }} + {{- partial "pen_card.html" . -}} + {{ else }} + {{- partial "shout_card.html" . -}} + {{ end }} + + {{ else if eq .Section "social" }} + {{- partial "social_card.html" . -}} + + {{ else if eq .Section "publications"}} + {{- partial "book_card.html" . -}} + + {{ else if eq .Section "sounds"}} + {{- partial "sounds_card.html" . -}} + + {{ else }} + {{- partial "card.html" . -}} + {{ end }} + + {{ end }} {{ end }} - {{- partial "filter-nav.html" . -}} -
@@ -42,3 +39,4 @@
+ \ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/network_card.html b/themes/lumbung-theme/layouts/partials/network_card.html deleted file mode 100644 index dae6e92..0000000 --- a/themes/lumbung-theme/layouts/partials/network_card.html +++ /dev/null @@ -1,47 +0,0 @@ -
-
-
- {{ $postPermalink := .Permalink}} - -

{{ .Title }}

-
- -
From {{ if .Params.authors }}{{range .Params.authors}} {{ . }} {{end}} at {{ end }}{{ .Params.feed_name }}
- - {{ if .Params.featured_image }} - {{ $img := .Resources.GetMatch .Params.featured_image }} - {{ $height := add $img.Height 0.0}} - {{ $ratio := div $height $img.Width}} - {{ $thumb := $img.Fit "540x540 q80 webp"}} -
-
- {{ .Title }} -
- {{ else if (.Resources.ByType "image") }} - {{ with (index (.Resources.ByType "image") 0) }} - {{ $img := . }} - {{ $height := add .Height 0.0}} - {{ $ratio := div $height .Width}} - {{ $thumb := .Fit "540x540 q80 webp"}} -
-
- {{ .Title }} -
- {{ end }} - {{ else }} -
- {{ end }} -
- {{ .Summary }} -
-
- - -
-
diff --git a/themes/lumbung-theme/layouts/partials/pen_card.html b/themes/lumbung-theme/layouts/partials/pen_card.html index ef2b213..b1cac10 100644 --- a/themes/lumbung-theme/layouts/partials/pen_card.html +++ b/themes/lumbung-theme/layouts/partials/pen_card.html @@ -1,7 +1,7 @@
-
From {{ if .Params.author }}{{.Params.author}} at {{ end }}{{ .Params.feed_name }}
+
From {{ if .Params.contributors }}{{range .Params.contributors}} {{ . }} {{end}} at {{ end }}{{ .Params.feed_name }}
{{ $postPermalink := .Permalink}} diff --git a/themes/lumbung-theme/layouts/partials/shout_card.html b/themes/lumbung-theme/layouts/partials/shout_card.html index 625164e..982cd21 100644 --- a/themes/lumbung-theme/layouts/partials/shout_card.html +++ b/themes/lumbung-theme/layouts/partials/shout_card.html @@ -1,49 +1,48 @@
-
-
- {{ $postPermalink := .Permalink}} -

- {{ range $i, $e := .Params.tags -}} - {{- if $i -}} {{ end -}} - #{{ $e | humanize | lower }} - {{- end -}} -

-
+
+
+ {{ $postPermalink := .Permalink}} + +

{{ .Title }}

+
+ +
From {{ if .Params.contributors }}{{range .Params.contributors}} {{ . }} {{end}} at {{ end }}{{ .Params.feed_name }}
- {{ with (index (.Resources.ByType "video") 0) }} - {{/* TODO this current logic does not suport video & image mixed */}} -
- - {{ else}} - {{ with (index (.Resources.ByType "image") 0) }} - {{ $height := add .Height 0.0}} - {{ $ratio := div $height .Width}} - {{ $thumb := .Fit "540x540 q80 webp"}} -
-
- {{ .Title }} + {{ if .Params.featured_image }} + {{ with $img := .Resources.GetMatch .Params.featured_image }} + {{ $height := add $img.Height 0.0}} + {{ $ratio := div $height $img.Width}} + {{ $thumb := $img.Fit "540x540 q80 webp"}} +
+
+ {{ .Title }} +
+ {{end}} + {{ else if (.Resources.ByType "image") }} + {{ with (index (.Resources.ByType "image") 0) }} + {{ $img := . }} + {{ $height := add .Height 0.0}} + {{ $ratio := div $height .Width}} + {{ $thumb := .Fit "540x540 q80 webp"}} +
+
+ {{ .Title }} +
+ {{ end }} + {{ else }} +
+ {{ end }} +
+ {{ .Summary }}
- {{ else }} -
- {{ end }} - {{ end }} -
- {{ .Summary }} -
-
-
- -
- - {{ if .Truncated }} - - - {{ end }} -
-
-
+
+ + + + diff --git a/themes/lumbung-theme/layouts/partials/social_card.html b/themes/lumbung-theme/layouts/partials/social_card.html new file mode 100644 index 0000000..d9c08d0 --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/social_card.html @@ -0,0 +1,49 @@ +
+ +
diff --git a/themes/lumbung-theme/static/css/main.css b/themes/lumbung-theme/static/css/main.css index c2a807e..1cd9692 100644 --- a/themes/lumbung-theme/static/css/main.css +++ b/themes/lumbung-theme/static/css/main.css @@ -174,8 +174,9 @@ a { .home-link { display: block; max-width: 700px; - width: 70%; + width: 50%; padding: 0; + margin: auto; } .logo { @@ -184,7 +185,7 @@ a { height: auto; } -#top-menu .login-link { +.login-link { background: #009d9b; padding: 5px 30px; color: #fff; @@ -194,7 +195,6 @@ a { .menu-row { margin: 0 auto; max-width: 80%; - width: 100%; display: flex; justify-content: space-between; align-items: center; @@ -408,6 +408,7 @@ a { .h-entry header h2 a { text-decoration: none; color: var(--border-color); + word-wrap: anywhere; } .h-entry header .header-metadata { @@ -475,9 +476,9 @@ footer.post-footer { } -/* network cards */ +/* shout cards */ -.card.network { +.card.shout { border: 2px solid var(--shouts-dark); background-color: var(--shouts-light); max-width: min-content; @@ -489,70 +490,70 @@ footer.post-footer { } -.h-entry.network header { +.h-entry.shout header { display: flex; flex-direction: column; } -.h-entry.network header h2 { +.h-entry.shout header h2 { padding: 0.2em 0.5em 0.5em 0.5em; margin: 0; border: none; } -.h-entry.network header h2:hover { +.h-entry.shout header h2:hover { cursor: pointer; } -.h-entry.network header h2 a { +.h-entry.shout header h2 a { text-decoration: none; color: var(--shouts-dark); } -.h-entry.network header time { +.h-entry.shout header time { text-align: right; padding: 0.6em 0.8em; font-size: 1rem; } -.network .header-metadata { +.shout .header-metadata { align-items: center; } -.network .header-metadata .dt-published { +.shout .header-metadata .dt-published { border-bottom: 2px solid var(--shouts-dark); } -.network .filler { +.shout .filler { min-height: 1rem; } -.network .author.p-author { +.shout .author.p-author { border-color: var(--shouts-dark); padding: 0.5em 1.2em 0.5em 1.2em; } -.network .p-summary { +.shout .p-summary { display: flex; } -.network .p-summary.portrait { +.shout .p-summary.portrait { /* flex-direction: row; */ } -.network .p-summary.landscape { +.shout .p-summary.landscape { flex-direction: column; } -.network .summary-image > img { +.shout .summary-image > img { display: inherit; } -.network .summary-text { +.shout .summary-text { font-size: 18px; } -div.network-source { +div.shout-source { padding: 1em; padding-right: 2em; width: fit-content; @@ -565,7 +566,7 @@ div.network-source { right: 1em; } -.network-source .triangle { +.shout-source .triangle { position: absolute; right: 0px; bottom: 0; @@ -576,17 +577,17 @@ div.network-source { fill: var(--shouts-dark); } -.network-source a { +.shout-source a { font-weight: bold; color: white; } -.network .footer-filler { +.shout .footer-filler { border-left: 2px solid var(--shouts-dark); border-top: none; } -.network footer.post-footer { +.shout footer.post-footer { border-top: 2px solid var(--shouts-dark); flex-flow: row; font-size: 0.9rem; @@ -595,17 +596,17 @@ div.network-source { padding: 1em; } -.network footer svg { +.shout footer svg { fill: var(--shouts-dark) } -.network .read-more { +.shout .read-more { border: none; border-left: 2px solid var(--shouts-dark); padding: 0.5em 1.2em 0.5em 1.2em; } -.network .footer-metadata { +.shout .footer-metadata { padding: 0.5em 1.2em 0.5em 1.2em; } @@ -736,9 +737,9 @@ div.pen-source { padding: 0.5em 1.2em 0.5em 1.2em; } -/* shouts cards */ +/* social / hashtag cards */ -.card.shout { +.card.social { border-color: steelblue; border: 2px solid; background-color: aliceblue; @@ -750,24 +751,24 @@ div.pen-source { color: steelblue; } -.card.shout h2 a { +.card.social h2 a { color: var(--social-dark); cursor: pointer; display: block; word-wrap: anywhere; } -.card .card.shout h2 a:hover { +.card .card.social h2 a:hover { border: none; text-decoration: none; } -.card.shout .post-footer { +.card.social .post-footer { background: var(--social-light); color: var(--social-dark); } -.card.shout .post-footer a{ +.card.social .post-footer a{ background: var(--social-light); color: var(--social-dark); text-decoration: underline; @@ -775,42 +776,42 @@ div.pen-source { /* gallery cards */ -.card.shout.lumbung-gallery { +.card.social.lumbunggallery { border-color: var(--gallery-dark); background-color: var(--gallery-light); color: var(--gallery-dark); } -.card.shout.lumbung-gallery h2 a { +.card.social.lumbunggallery h2 a { color: var(--gallery-dark); } -.card.shout.lumbung-gallery .post-footer { +.card.social.lumbunggallery .post-footer { background: var(--gallery-light); color: var(--gallery-dark); border-top: 2px solid; } /* kios cards */ -.card.shout.lumbung-kios { +.card.social.lumbungkios { border-color: var(--kios-dark); background-color: var(--kios-light); color: var(--kios-dark); } -.card.shout.lumbung-kios h2 a { +.card.social.lumbungkios h2 a { color: var(--kios-dark); } -.card.shout.lumbung-kios .post-footer { +.card.social.lumbungkios .post-footer { background: var(--kios-light); color: var(--kios-dark); border-top: 2px solid; } -.card.shout.lumbung-kios .post-footer a { +.card.social.lumbungkios .post-footer a { background: none; color: var(--kios-dark); } @@ -1084,7 +1085,7 @@ li.page-item:after { /* FILTER */ .filter-item, .card, .video-box { - display: none; +/* display: none;*/ } .show-item { @@ -1911,7 +1912,7 @@ a.timeline-url { /* card styles */ .card, - .card.network { + .card.shout { max-width: 83vw; } From ce945e77db5dc3694b5dde2800dfa399db7388f4 Mon Sep 17 00:00:00 2001 From: rra Date: Sun, 25 Sep 2022 09:10:37 +0200 Subject: [PATCH 3/7] WIP merge of Cristoph, filter, mobile view, menu rework --- themes/lumbung-theme/layouts/index.html | 30 +- .../lumbung-theme/layouts/partials/card.html | 2 +- .../layouts/partials/data/authors.html | 1 + .../layouts/partials/data/categories.html | 1 + .../layouts/partials/data/tags.html | 1 + .../layouts/partials/filter-nav.html | 191 +++----- .../layouts/partials/footer.html | 9 +- .../layouts/partials/header.html | 25 +- .../layouts/partials/pen_card.html | 2 +- .../layouts/partials/shout_card.html | 2 +- .../layouts/partials/social_card.html | 2 +- .../layouts/partials/video_box.html | 2 +- themes/lumbung-theme/static/css/main.css | 459 +++++++++++++----- themes/lumbung-theme/static/img/logo-big.svg | 21 + 14 files changed, 496 insertions(+), 252 deletions(-) create mode 100644 themes/lumbung-theme/layouts/partials/data/authors.html create mode 100644 themes/lumbung-theme/layouts/partials/data/categories.html create mode 100644 themes/lumbung-theme/layouts/partials/data/tags.html create mode 100644 themes/lumbung-theme/static/img/logo-big.svg diff --git a/themes/lumbung-theme/layouts/index.html b/themes/lumbung-theme/layouts/index.html index a5c69ec..263beb9 100644 --- a/themes/lumbung-theme/layouts/index.html +++ b/themes/lumbung-theme/layouts/index.html @@ -1,12 +1,16 @@ {{ define "main" }} +
-
-{{ range (.Paginate (.Site.RegularPages.GroupByDate "January 2006") 20 ).PageGroups }} - - {{ .Key }} - {{ range .Pages }} +
+ {{ $range := .Site.RegularPages }} + {{ $paginator := .Paginate $range }} + {{ $pageSize := $paginator.PageSize }} + {{ $totalPostsToShow := mul $paginator.PageNumber $pageSize }} + {{ range $index, $el := (first $totalPostsToShow .Site.RegularPages) }} + +
{{if eq .Section "tv"}} {{- partial "video_box.html" . -}} @@ -32,13 +36,17 @@ {{ else }} {{- partial "card.html" . -}} {{ end }} - - {{ end }} +
{{ end }}
- + + +
@@ -46,5 +54,7 @@ lumbung radio
+ +
{{ end }} \ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/card.html b/themes/lumbung-theme/layouts/partials/card.html index 9154a32..bffc5b2 100644 --- a/themes/lumbung-theme/layouts/partials/card.html +++ b/themes/lumbung-theme/layouts/partials/card.html @@ -1,4 +1,4 @@ -
+

{{ .Title }}

diff --git a/themes/lumbung-theme/layouts/partials/data/authors.html b/themes/lumbung-theme/layouts/partials/data/authors.html new file mode 100644 index 0000000..69be009 --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/data/authors.html @@ -0,0 +1 @@ +{{ with .Params.authors }}{{ if eq ( printf "%T" . ) "string" }}{{ . | replaceRE "[.]" "_" | urlize }}{{ else if eq ( printf "%T" . ) "[]string" }}{{ range . }}{{ . | replaceRE "[.]" "_" | urlize }} {{end}}{{end}}{{else}}no-author{{end}} \ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/data/categories.html b/themes/lumbung-theme/layouts/partials/data/categories.html new file mode 100644 index 0000000..9303037 --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/data/categories.html @@ -0,0 +1 @@ +{{ with .Params.categories }}{{ if eq ( printf "%T" . ) "string" }}{{ . | replaceRE "[.]" "_" | urlize }}{{ else if eq ( printf "%T" . ) "[]string" }}{{ range . }}{{ . | replaceRE "[.]" "_" | urlize }} {{end}}{{end}}{{else}}no-cat{{end}} \ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/data/tags.html b/themes/lumbung-theme/layouts/partials/data/tags.html new file mode 100644 index 0000000..6cb4851 --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/data/tags.html @@ -0,0 +1 @@ +{{ with .Params.tags }}{{ range . }}{{ . | replaceRE "[.]" "_" | urlize }} {{ end }}{{ else }} tfuntagged{{ end }} \ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/filter-nav.html b/themes/lumbung-theme/layouts/partials/filter-nav.html index 10b8ac0..ef472c8 100644 --- a/themes/lumbung-theme/layouts/partials/filter-nav.html +++ b/themes/lumbung-theme/layouts/partials/filter-nav.html @@ -1,121 +1,90 @@ - +
+ -{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} -{{ $sections := .Site.Params.mainSections }} - -{{ $.Scratch.Set "authors" (slice ) }} -{{ $.Scratch.Set "noAuthors" 0 }} - -{{ range where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} - {{ with .Params.authors }} - {{ if eq ( printf "%T" . ) "[]string" }} - {{ if ( not ( in ($.Scratch.Get "authors") . ) ) }} - {{ $.Scratch.Add "authors" . }} - {{ end }} - {{ else if ( printf "%T" . ) "[]string" }} - {{ range . }} - {{ if ( not ( in ($.Scratch.Get "authors") . ) ) }} - {{ $.Scratch.Add "authors" . }} - {{ end }} - {{ end }} + {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} + {{ $sections := .Site.Params.mainSections }} + {{ $tags := $.Site.Taxonomies.tags.ByCount }} + {{ $.Scratch.Set "untagged" 0 }} + {{ range $pages }} + {{ with .Params.tags }}{{ else }}{{ $.Scratch.Add "untagged" 1 }}{{ end }} {{ end }} - {{ else }} - {{ $.Scratch.Add "noAuthors" 1 }} - {{ end }} -{{ end }} -{{ $.Scratch.Set "cats" (slice ) }} -{{ $.Scratch.Set "nocat" 0 }} +
+
+
Cards
+
+
+
+ +
+ {{ range $sections }} + + {{ end }} + +
+
-{{ range where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} - {{ with .Params.categories }} - {{ if eq ( printf "%T" . ) "[]string" }} - {{ if ( not ( in ($.Scratch.Get "cats") . ) ) }} - {{ $.Scratch.Add "cats" . }} - {{ end }} - - {{ end }} - {{ else }} - {{ $.Scratch.Add "nocat" 1 }} - {{ end }} -{{ end }} +
+ +
+ {{ range .Site.Taxonomies.authors }} + + {{ end }} + + +
+
-{{ $tags := $.Site.Taxonomies.tags.ByCount }} +
+ +
+ {{ range .Site.Taxonomies.categories }} + + {{ end }} + + +
+
-{{ $.Scratch.Set "untagged" 0 }} -{{ range $pages }} - {{ with .Params.tags }}{{ else }}{{ $.Scratch.Add "untagged" 1 }}{{ end }} -{{ end }} - -
-
-
Items
- Load all Items -
-
- - {{ range $sections }} - - {{ end }} +
+ +
+ {{ range $tags }} + {{ if .Term }} + + {{ end }} + {{ end }} + + +
+
+ +
-
- - - {{ range .Site.Taxonomies.authors }} - - {{ end }} - - {{ if gt ( $.Scratch.Get "noAuthors") 0 }} - - {{ end }} -
- -
- - - {{ range .Site.Taxonomies.categories }} - - {{ end }} - - {{ if gt ( $.Scratch.Get "nocat") 0 }} - - {{ end }} -
- -
- - {{ range $tags }} - {{ if .Term }} - - {{ end }} - {{ end }} - {{ if gt ( $.Scratch.Get "untagged") 0 }} - - {{ end }} -
\ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/footer.html b/themes/lumbung-theme/layouts/partials/footer.html index c8c9ced..0f6cf82 100644 --- a/themes/lumbung-theme/layouts/partials/footer.html +++ b/themes/lumbung-theme/layouts/partials/footer.html @@ -1,7 +1,7 @@
- +
lumbung.space is a social and publishing platform for sharing harvests by all members online. It is non-extractive, co governed by the users, and is built on open platforms.
@@ -18,4 +18,9 @@ -
\ No newline at end of file + + + + \ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/header.html b/themes/lumbung-theme/layouts/partials/header.html index 23111b8..c586d2b 100644 --- a/themes/lumbung-theme/layouts/partials/header.html +++ b/themes/lumbung-theme/layouts/partials/header.html @@ -6,7 +6,7 @@
- -
- \ No newline at end of file + + diff --git a/themes/lumbung-theme/layouts/partials/pen_card.html b/themes/lumbung-theme/layouts/partials/pen_card.html index b1cac10..b542750 100644 --- a/themes/lumbung-theme/layouts/partials/pen_card.html +++ b/themes/lumbung-theme/layouts/partials/pen_card.html @@ -1,4 +1,4 @@ -
+
From {{ if .Params.contributors }}{{range .Params.contributors}} {{ . }} {{end}} at {{ end }}{{ .Params.feed_name }}
diff --git a/themes/lumbung-theme/layouts/partials/shout_card.html b/themes/lumbung-theme/layouts/partials/shout_card.html index 982cd21..9e77acc 100644 --- a/themes/lumbung-theme/layouts/partials/shout_card.html +++ b/themes/lumbung-theme/layouts/partials/shout_card.html @@ -1,4 +1,4 @@ -
+
{{ $postPermalink := .Permalink}} diff --git a/themes/lumbung-theme/layouts/partials/social_card.html b/themes/lumbung-theme/layouts/partials/social_card.html index d9c08d0..518baa5 100644 --- a/themes/lumbung-theme/layouts/partials/social_card.html +++ b/themes/lumbung-theme/layouts/partials/social_card.html @@ -1,4 +1,4 @@ -
- {{ with (index (.Resources.ByType "image") 0) }} - {{ $height := add .Height 0.0}} - {{ $ratio := div $height .Width}} - {{ $thumb := .Fit "540x540 q80 webp"}} -
-
- {{ .Title }} -
- {{ else }} -
- {{ end }} -
-

- {{.Title}}

-
-
- {{ .Summary }} -
-
-
- -
-
-
+ {{ with (index (.Resources.ByType "image") 0) }} + {{ $height := add .Height 0.0}} + {{ $ratio := div $height .Width}} + {{ $thumb := .Fit "540x540 q80 webp"}} +
+
+ {{ .Title }}
+ {{ else }} +
+ {{ end }} +
+

+ {{.Title}}

+
+
+ {{ .Summary }} +
+
+
+ +
+
+
+
diff --git a/themes/lumbung-theme/layouts/partials/calendar_card.html b/themes/lumbung-theme/layouts/partials/calendar_card.html index c41cfa9..3a20ffc 100644 --- a/themes/lumbung-theme/layouts/partials/calendar_card.html +++ b/themes/lumbung-theme/layouts/partials/calendar_card.html @@ -1,5 +1,5 @@ {{ $t := (time .Params.event_end) }} -
+
{{ substr .Params.date 0 11}}
diff --git a/themes/lumbung-theme/layouts/partials/card.html b/themes/lumbung-theme/layouts/partials/card.html index bffc5b2..5cbaa86 100644 --- a/themes/lumbung-theme/layouts/partials/card.html +++ b/themes/lumbung-theme/layouts/partials/card.html @@ -1,4 +1,4 @@ -
+

{{ .Title }}

diff --git a/themes/lumbung-theme/layouts/partials/data/contributors.html b/themes/lumbung-theme/layouts/partials/data/contributors.html new file mode 100644 index 0000000..20dce32 --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/data/contributors.html @@ -0,0 +1 @@ +{{ with .Params.contributors }}{{ if eq ( printf "%T" . ) "string" }}{{ . | replaceRE "[.]" "_" | urlize }}{{ else if eq ( printf "%T" . ) "[]string" }}{{ range . }}{{ . | replaceRE "[.]" "_" | urlize }} {{end}}{{end}}{{else}}no-contributor{{end}} \ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/data/sources.html b/themes/lumbung-theme/layouts/partials/data/sources.html new file mode 100644 index 0000000..d39e141 --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/data/sources.html @@ -0,0 +1 @@ +{{ with .Params.sources }}{{ if eq ( printf "%T" . ) "string" }}{{ . | replaceRE "[.]" "_" | urlize }}{{ else if eq ( printf "%T" . ) "[]string" }}{{ range . }}{{ . | replaceRE "[.]" "_" | urlize }} {{end}}{{end}}{{else}}no-sources{{end}} \ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/event_list_item.html b/themes/lumbung-theme/layouts/partials/event_list_item.html new file mode 100644 index 0000000..524ea99 --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/event_list_item.html @@ -0,0 +1,19 @@ +{{ $t := (time .Params.event_end) }} +
+
{{ substr .Params.event_begin 0 11}}
+ +
+
+ + {{ .Params.localized_begin | markdownify }} + +
+
+
Duration: {{ .Params.duration }}
+
{{ .Params.location | markdownify }}
+ + +
+ {{.Content}} +
+
\ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/filter-nav.html b/themes/lumbung-theme/layouts/partials/filter-nav.html index ef472c8..da36f2c 100644 --- a/themes/lumbung-theme/layouts/partials/filter-nav.html +++ b/themes/lumbung-theme/layouts/partials/filter-nav.html @@ -34,14 +34,14 @@ by contributors
- {{ range .Site.Taxonomies.authors }} - {{ end }} - -
@@ -52,13 +52,13 @@ by sources
- {{ range .Site.Taxonomies.categories }} - {{ end }} - -
diff --git a/themes/lumbung-theme/layouts/partials/footer.html b/themes/lumbung-theme/layouts/partials/footer.html index 0f6cf82..3c74e2b 100644 --- a/themes/lumbung-theme/layouts/partials/footer.html +++ b/themes/lumbung-theme/layouts/partials/footer.html @@ -22,5 +22,5 @@ \ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/head.html b/themes/lumbung-theme/layouts/partials/head.html index 38b375f..11ab989 100644 --- a/themes/lumbung-theme/layouts/partials/head.html +++ b/themes/lumbung-theme/layouts/partials/head.html @@ -25,4 +25,5 @@ {{ with .OutputFormats.Get "rss" -}} {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} + diff --git a/themes/lumbung-theme/layouts/partials/header.html b/themes/lumbung-theme/layouts/partials/header.html index c586d2b..28d24c3 100644 --- a/themes/lumbung-theme/layouts/partials/header.html +++ b/themes/lumbung-theme/layouts/partials/header.html @@ -17,7 +17,7 @@
  • contributors
  • -
  • calendar
  • +
  • events
  • tv
  • social
  • pen
  • @@ -31,17 +31,14 @@
  • books
  • - - {{ if .Site.Params.mainSections }} - {{- partial "filter-nav.html" . -}} - {{ end }} -
    + - + +
    diff --git a/themes/lumbung-theme/layouts/partials/pen_card.html b/themes/lumbung-theme/layouts/partials/pen_card.html index b542750..4accc6d 100644 --- a/themes/lumbung-theme/layouts/partials/pen_card.html +++ b/themes/lumbung-theme/layouts/partials/pen_card.html @@ -1,7 +1,7 @@ -
    +
    -
    From {{ if .Params.contributors }}{{range .Params.contributors}} {{ . }} {{end}} at {{ end }}{{ .Params.feed_name }}
    +
    From {{ if .Params.author }}{{.Params.author}} at {{ end }}{{ .Params.feed_name }}
    {{ $postPermalink := .Permalink}} diff --git a/themes/lumbung-theme/layouts/partials/shout_card.html b/themes/lumbung-theme/layouts/partials/shout_card.html index 9e77acc..c3ee38b 100644 --- a/themes/lumbung-theme/layouts/partials/shout_card.html +++ b/themes/lumbung-theme/layouts/partials/shout_card.html @@ -1,48 +1,48 @@ -
    -
    -
    - {{ $postPermalink := .Permalink}} - -

    {{ .Title }}

    -
    - -
    From {{ if .Params.contributors }}{{range .Params.contributors}} {{ . }} {{end}} at {{ end }}{{ .Params.feed_name }}
    +
    +
    +
    + {{ $postPermalink := .Permalink}} + +

    {{ .Title }}

    +
    + +
    From {{ if .Params.contributors }}{{range .Params.contributors}} {{ . }} {{end}} at {{ end }}{{ .Params.feed_name }}
    - {{ if .Params.featured_image }} - {{ with $img := .Resources.GetMatch .Params.featured_image }} - {{ $height := add $img.Height 0.0}} - {{ $ratio := div $height $img.Width}} - {{ $thumb := $img.Fit "540x540 q80 webp"}} -
    -
    - {{ .Title }} -
    - {{end}} - {{ else if (.Resources.ByType "image") }} - {{ with (index (.Resources.ByType "image") 0) }} - {{ $img := . }} - {{ $height := add .Height 0.0}} - {{ $ratio := div $height .Width}} - {{ $thumb := .Fit "540x540 q80 webp"}} -
    -
    - {{ .Title }} -
    - {{ end }} - {{ else }} -
    - {{ end }} -
    - {{ .Summary }} -
    -
    - - -
    + {{ if .Params.featured_image }} + {{ with $img := .Resources.GetMatch .Params.featured_image }} + {{ $height := add $img.Height 0.0}} + {{ $ratio := div $height $img.Width}} + {{ $thumb := $img.Fit "540x540 q80 webp"}} +
    +
    + {{ .Title }} +
    + {{end}} + {{ else if (.Resources.ByType "image") }} + {{ with (index (.Resources.ByType "image") 0) }} + {{ $img := . }} + {{ $height := add .Height 0.0}} + {{ $ratio := div $height .Width}} + {{ $thumb := .Fit "540x540 q80 webp"}} +
    +
    + {{ .Title }}
    + {{ end }} + {{ else }} +
    + {{ end }} +
    + {{ .Summary }} +
    +
    + + +
    +
    diff --git a/themes/lumbung-theme/layouts/partials/social_card.html b/themes/lumbung-theme/layouts/partials/social_card.html index 518baa5..ebff12f 100644 --- a/themes/lumbung-theme/layouts/partials/social_card.html +++ b/themes/lumbung-theme/layouts/partials/social_card.html @@ -1,49 +1,49 @@ - \ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/video_box.html b/themes/lumbung-theme/layouts/partials/video_box.html index a6f7d4f..4a9f418 100644 --- a/themes/lumbung-theme/layouts/partials/video_box.html +++ b/themes/lumbung-theme/layouts/partials/video_box.html @@ -1,4 +1,4 @@ -
    +
    Date: Wed, 28 Sep 2022 15:12:51 +0200 Subject: [PATCH 5/7] rename events to calendar in menu --- themes/lumbung-theme/layouts/partials/header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/lumbung-theme/layouts/partials/header.html b/themes/lumbung-theme/layouts/partials/header.html index 28d24c3..d29fae1 100644 --- a/themes/lumbung-theme/layouts/partials/header.html +++ b/themes/lumbung-theme/layouts/partials/header.html @@ -17,7 +17,7 @@
  • contributors
  • -
  • events
  • +
  • calendar
  • tv
  • social
  • pen
  • From 58efb45a8c7feae3c04ba8ac676e9d28fa45f101 Mon Sep 17 00:00:00 2001 From: rra Date: Thu, 29 Sep 2022 16:03:36 +0200 Subject: [PATCH 6/7] only show upcoming events section if there are upcoming events --- themes/lumbung-theme/layouts/events/list.html | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/themes/lumbung-theme/layouts/events/list.html b/themes/lumbung-theme/layouts/events/list.html index 387ce42..739ad2c 100644 --- a/themes/lumbung-theme/layouts/events/list.html +++ b/themes/lumbung-theme/layouts/events/list.html @@ -3,26 +3,36 @@
    {{ $now := (now.Format "060102" ) }} -
    -
    upcoming events
    - {{ range .Pages }} + + {{ $upcoming := slice }} + {{ $past := slice}} + + {{ range .Pages }} {{ $t := (substr .Params.event_end 2 8) }} {{ $time := ( replace $t "-" "") }} {{ if ge $time $now }} - {{- partial "event_list_item.html" . -}} + {{ $upcoming = $upcoming | append . }} + {{ else if gt $now $time }} + {{ $past = $past | append . }} {{ end }} {{ end }} -
    + + {{ with $upcoming }} +
    +
    upcoming events
    + {{ range $upcoming}} + {{- partial "event_list_item.html" . -}} + {{end}} +
    + {{end}} + {{ with $past }}
    past events
    - {{ range .Pages }} - {{ $t := (substr .Params.event_end 2 8) }} - {{ $time := ( replace $t "-" "") }} - {{ if gt $now $time }} - {{- partial "event_list_item.html" . -}} - {{ end }} + {{ range $past }} + {{- partial "event_list_item.html" . -}} {{ end }}
    + {{ end }}
    From 72e2872a2bc2530f51052d6eaacb773fe58ce5d7 Mon Sep 17 00:00:00 2001 From: rra Date: Mon, 10 Oct 2022 09:35:35 +0200 Subject: [PATCH 7/7] final fixes from Cristoph --- .../layouts/_default/baseof.html | 81 +++++++++++++++++-- .../lumbung-theme/layouts/_default/list.html | 72 +++++++++-------- themes/lumbung-theme/layouts/index.html | 6 +- .../layouts/partials/filter-nav.html | 1 + .../layouts/partials/footer.html | 7 +- .../layouts/partials/header.html | 2 +- .../layouts/partials/social_card.html | 2 +- themes/lumbung-theme/static/css/main.css | 20 ++++- 8 files changed, 136 insertions(+), 55 deletions(-) diff --git a/themes/lumbung-theme/layouts/_default/baseof.html b/themes/lumbung-theme/layouts/_default/baseof.html index 9e34d4e..007eb1a 100644 --- a/themes/lumbung-theme/layouts/_default/baseof.html +++ b/themes/lumbung-theme/layouts/_default/baseof.html @@ -11,6 +11,8 @@ {{- partial "news-ticker.html" . -}} {{- partial "footer.html" . -}} + + diff --git a/themes/lumbung-theme/layouts/_default/list.html b/themes/lumbung-theme/layouts/_default/list.html index 094ef4d..9178d35 100644 --- a/themes/lumbung-theme/layouts/_default/list.html +++ b/themes/lumbung-theme/layouts/_default/list.html @@ -1,40 +1,48 @@ {{ define "main" }}
    -
    - {{ range where (.Paginator 13).Pages "Params.hidden" "ne" "true" }} - +
    + {{ $range := where .Pages "Params.hidden" "ne" "true" }} + {{ $paginator := .Paginate $range }} + {{ $pageSize := $paginator.PageSize }} + {{ $totalPostsToShow := mul $paginator.PageNumber $pageSize }} + {{ range $index, $el := (first $totalPostsToShow $range) }} + +
    {{if eq .Section "tv"}} - {{- partial "video_box.html" . -}} - - {{ else if eq .Section "events" }} - {{- partial "partials/calendar_card.html" . -}} - - {{ else if eq .Section "shouts" }} - {{ if in .Params.sources "pen.lumbung.space" }} - {{- partial "pen_card.html" . -}} - {{ else }} - {{- partial "shout_card.html" . -}} - {{ end }} - - {{ else if eq .Section "social" }} - {{- partial "social_card.html" . -}} - - {{ else if eq .Section "publications"}} - {{- partial "book_card.html" . -}} - - {{ else if eq .Section "sounds"}} - {{- partial "sounds_card.html" . -}} - - {{ else }} - {{- partial "card.html" . -}} - - {{ end }} + {{- partial "video_box.html" . -}} + + {{ else if eq .Section "events" }} + {{- partial "partials/calendar_card.html" . -}} + + {{ else if eq .Section "shouts" }} + {{ if in .Params.sources "pen.lumbung.space" }} + {{- partial "partials/pen_card.html" . -}} + {{ else }} + {{- partial "partials/shout_card.html" . -}} + {{ end }} + + {{ else if eq .Section "social" }} + {{- partial "partials/social_card.html" . -}} + + {{ else if eq .Section "publications"}} + {{- partial "partials/book_card.html" . -}} + + {{ else if eq .Section "sounds"}} + {{- partial "sounds_card.html" . -}} + + {{ else }} + {{- partial "card.html" . -}} + {{ end }} +
    {{ end }}
    - - + + +
    {{ end }} \ No newline at end of file diff --git a/themes/lumbung-theme/layouts/index.html b/themes/lumbung-theme/layouts/index.html index 9db5fab..190ba06 100644 --- a/themes/lumbung-theme/layouts/index.html +++ b/themes/lumbung-theme/layouts/index.html @@ -1,5 +1,4 @@ {{ define "main" }} -
    @@ -42,9 +41,8 @@
    @@ -54,8 +52,6 @@ lumbung radio
    - -
    diff --git a/themes/lumbung-theme/layouts/partials/filter-nav.html b/themes/lumbung-theme/layouts/partials/filter-nav.html index da36f2c..373c62b 100644 --- a/themes/lumbung-theme/layouts/partials/filter-nav.html +++ b/themes/lumbung-theme/layouts/partials/filter-nav.html @@ -12,6 +12,7 @@
    Cards
    +
    load more cards
    diff --git a/themes/lumbung-theme/layouts/partials/footer.html b/themes/lumbung-theme/layouts/partials/footer.html index 3c74e2b..c75a630 100644 --- a/themes/lumbung-theme/layouts/partials/footer.html +++ b/themes/lumbung-theme/layouts/partials/footer.html @@ -18,9 +18,4 @@ - - - - \ No newline at end of file + \ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/header.html b/themes/lumbung-theme/layouts/partials/header.html index d29fae1..ba3b1a0 100644 --- a/themes/lumbung-theme/layouts/partials/header.html +++ b/themes/lumbung-theme/layouts/partials/header.html @@ -7,7 +7,7 @@