diff --git a/config/_default/config.toml b/config/_default/config.toml index 455f507..43b9fa9 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -9,3 +9,12 @@ copyright = "bunteshaus.de" defaultContentLanguageInSubdir = true defaultContentLanguage = "de" + +[related] + threshold = 10 + includeNewer = true + toLower = true + + [[related.indices]] + name = "tags" + weight = 90 diff --git a/config/_default/params.toml b/config/_default/params.toml index c1cb183..24f7fbb 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -26,10 +26,12 @@ mainMenu = ['about','news','events'] searchSections = ['news'] # how long stays a featrued article on frontpage as featured (in weeks) -featured_expire = "28" +featured_expire = "13" placeholder = "/images/no_article_pic.png" +items_per_list = 5 + # data for your imprint and contact page [imprintdata] tel = "(+) 49 5141 907 927" diff --git a/content/about/_index.de.md b/content/about/_index.de.md index 804bf0f..49bd138 100644 --- a/content/about/_index.de.md +++ b/content/about/_index.de.md @@ -1,6 +1,6 @@ --- title: "Über uns" -layout: "article_list" +layout: "gen_list" --- Wir sind das Buntehaus, ein [soziokulturelles](/bunteshaus/soziokultur) Zentrum in Celle. Wir leben vom mitmachen und so. diff --git a/themes/buha/assets/scss/big.scss b/themes/buha/assets/scss/big.scss index 6cec3b5..aa24e5a 100644 --- a/themes/buha/assets/scss/big.scss +++ b/themes/buha/assets/scss/big.scss @@ -4,4 +4,12 @@ margin-left: auto; margin-right: auto; } + .twolists { + display: flex; flex-wrap: wrap; justify-content: space-around; + div { + display: flex; + flex-direction: column; + width: 45%; + } + } } diff --git a/themes/buha/assets/scss/common.scss b/themes/buha/assets/scss/common.scss index f0c3a43..c66e7b1 100644 --- a/themes/buha/assets/scss/common.scss +++ b/themes/buha/assets/scss/common.scss @@ -89,8 +89,52 @@ section, article, .article_footer, .sidebar { flex-direction: column; } -.two-lists { - display: flex; flex-wrap: wrap; justify-content: space-around; + +.twolists { +} + +.gen_list { + a { text-decoration: none; + margin-bottom: 5rem; + &:hover { + .img { + height: 180px; + background-size: 110% auto; + background-position: top; + } + .img-only { + height: 360px; + background-size: 110% auto; + background-position: top; + } + } + } + img { + width: 100%; + } + h3 { + margin-top: 0rem; + } + section { + margin-right: 1rem; + margin-left: 1rem; + } + .img { + width: 100%; + height: 140px; + background-size: 100% auto; + background-position: top; + transition: all .3s ease-in-out; + background-repeat: no-repeat; + } + .img-only { + width: 100%; + height: 360px; + background-size: 100% auto; + background-position: top; + transition: all .2s ease-in-out; + background-repeat: no-repeat; + } } article { diff --git a/themes/buha/assets/scss/scss.scss b/themes/buha/assets/scss/scss.scss index f09f089..9a96573 100644 --- a/themes/buha/assets/scss/scss.scss +++ b/themes/buha/assets/scss/scss.scss @@ -106,4 +106,5 @@ article { .index_section { max-width: 42%; } } } + } diff --git a/themes/buha/layouts/_default/list.html b/themes/buha/layouts/_default/list.html index 08f86aa..d2fb4c3 100644 --- a/themes/buha/layouts/_default/list.html +++ b/themes/buha/layouts/_default/list.html @@ -15,11 +15,11 @@ {{- $paginator := "" -}} {{- $partial := .Layout -}} {{- $paginate := true -}} - {{- if eq .Layout "article_list" -}} + {{- if eq .Layout "gen_list" -}} {{ if eq .Section "events" }} {{- $pages = where $pages ".Params.when" "ne" nil -}} {{ else if eq .Type "about" }} - {{- $pages = where $pages ".Params.about" "=" true -}} + {{- $pages = (where $pages ".Params.about" "=" true) -}} {{ else if eq .Section "news" }} {{- $pages = .Data.Pages -}} {{ else if eq .Section "featured" }} @@ -30,7 +30,7 @@ {{ else }} {{ if eq .Kind "term" }} {{- $pages = .Data.Pages -}} - {{ $partial = "article_list" }} + {{ $partial = "gen_list" }} {{ else if eq .Kind "taxonomy" }} {{ $paginate = false }} {{- $pages = .Data.Terms.ByCount -}} @@ -40,7 +40,7 @@ {{ $partial = string (printf "layout/%s" $partial) }} - {{ partial $partial (dict "context" . "pages" $pages "amount" "5" "content" .Content "type" .Type "paginate" $paginate) }} + {{ partial $partial (dict "context" . "pages" $pages "content" .Content "type" .Type "paginate" $paginate) }} {{ end }} {{ define "sidebar" }} diff --git a/themes/buha/layouts/_default/single.html b/themes/buha/layouts/_default/single.html index 4042cf5..e886c60 100644 --- a/themes/buha/layouts/_default/single.html +++ b/themes/buha/layouts/_default/single.html @@ -17,6 +17,7 @@ {{ $partial = printf "layout/%s" .Layout }} {{ end }}
+ {{ partial $partial (dict "context" . "pic" $pic "content" .Content "partial_before" $partial_before "type" "article") }}
{{ end }} @@ -44,6 +45,13 @@ {{ end }} {{ end }} + {{ $related := .Site.RegularPages.RelatedIndices . "tags" | first 5 }} + {{ if $related }} +

Related

+ {{ range $related }} +
{{ .Title }}
+ {{ end }} + {{ end }} {{ end }} {{ end }} diff --git a/themes/buha/layouts/index.html b/themes/buha/layouts/index.html index d040d21..740f6e8 100644 --- a/themes/buha/layouts/index.html +++ b/themes/buha/layouts/index.html @@ -4,13 +4,9 @@ {{ $featured := where (where (where $all ".Params.featured" "=" true) "Type" "in" .Site.Params.searchSections) ".Params.Lastmod" "gt" (now.AddDate 0 0 $days) }} - {{ $featured = where (where $all ".Params.featured" "=" true) "Type" "in" .Site.Params.searchSections }} {{ $featured = $all | intersect $featured }} {{ $posts := $all | complement $featured }} - {{ if ne .Content "" }} - {{ partial "snippets/content" (dict "content" .Content) }} - {{ end }} {{ $news := "news" }} {{ if i18n $news }} {{ $news = i18n $news }} @@ -19,14 +15,14 @@ {{ if i18n $feat }} {{ $feat = i18n $feat }} {{ end }} - -
- {{ if gt (len $featured) 1 }} - {{ partial "layout/article_list" (dict "context" . "pages" $featured "amount" "1" "title" $feat "type" "index") }} - {{ end }} - {{ if gt (len $posts) 1 }} - {{ partial "layout/article_list" (dict "context" . "pages" $posts "amount" "3" "title" $news "type" "index") }} - {{ end }} + + {{ if ne .Content "" }} + {{ partial "snippets/content" (dict "content" .Content) }} + {{ end }} + +
+ {{ partial "layout/gen_list" (dict "context" . "pages" $featured "title" $feat )}} + {{ partial "layout/gen_list" (dict "context" . "pages" $posts "title" $news "limit" "5" )}}
{{ end }} diff --git a/themes/buha/layouts/partials/layout/gen_list.html b/themes/buha/layouts/partials/layout/gen_list.html new file mode 100644 index 0000000..1ed6256 --- /dev/null +++ b/themes/buha/layouts/partials/layout/gen_list.html @@ -0,0 +1,63 @@ +{{ $p := .pages }} +{{ if and (.limit) (not .paginate) }} + {{ $p = first .limit .pages }} +{{ end }} + +{{ $paginator := .pages }} +{{ if .paginate }} + {{ $paginator = .context.Paginate $p }} + {{ $p = $paginator.Pages }} +{{ end }} + +{{ if or .content (and (.paginate) (.content) (eq $paginator.PageNumber 1)) }} + {{ partial "snippets/content" (dict "content" .context.Content) }} +{{ end }} + +{{ if $p }} +
+ {{ if .title }}

{{ .title }}

{{ end }} + {{ range $p }} + + {{ $banner := slice }} + {{ $image := slice }} + {{ $images := slice }} + {{ if .Resources.GetMatch "banner*" }} + {{ $banner = slice (.Resources.GetMatch "banner*") }} + {{ end }} + {{ if .Resources.ByType "image" }} + {{ $image = .Resources.ByType "image" }} + {{ end }} + {{ $images = complement $banner $image }} + {{ $image = (index (complement $banner $image) 0) }} + {{ $banner = (index $banner 0) }} + + + +
+

+ {{ .Title }} +

+ {{ with .Resources.GetMatch $banner }} +
+
+ {{ end }} + {{ if .Description }} + {{ .Description }} + {{ else if .Summary }} +

{{ .Summary }}

+ {{ else if .Content }} + {{ .Content }} + {{ else if $image }} + {{ $i := (.Resources.GetMatch $image).Permalink }} +
+
+ {{ end }} +
+
+ {{ end }} + + {{ if .paginate }} + {{ partial "snippets/paginator" (dict "paginator" $paginator) }} + {{ end }} +
+{{ end }} diff --git a/themes/buha/static/fonts/NanumGothic-Bold.ttf b/themes/buha/static/fonts/NanumGothic-Bold.ttf new file mode 100644 index 0000000..a9a40dc Binary files /dev/null and b/themes/buha/static/fonts/NanumGothic-Bold.ttf differ diff --git a/themes/buha/static/fonts/NanumGothic-ExtraBold.ttf b/themes/buha/static/fonts/NanumGothic-ExtraBold.ttf new file mode 100644 index 0000000..25a8b46 Binary files /dev/null and b/themes/buha/static/fonts/NanumGothic-ExtraBold.ttf differ diff --git a/themes/buha/static/fonts/NanumGothic-Regular.ttf b/themes/buha/static/fonts/NanumGothic-Regular.ttf new file mode 100644 index 0000000..6e4dd87 Binary files /dev/null and b/themes/buha/static/fonts/NanumGothic-Regular.ttf differ diff --git a/themes/buha/static/js/generator.js b/themes/buha/static/js/generator.js index d8595eb..73e8003 100644 --- a/themes/buha/static/js/generator.js +++ b/themes/buha/static/js/generator.js @@ -11,37 +11,46 @@ function check_checkboxes(name) { } } +function typeInTextarea(newText, el = document.getElementById('content')) { + const [start, end] = [el.selectionStart, el.selectionEnd]; + el.setRangeText(newText, start, end); +} + function button(x) { - if (x == "url") { - let url = prompt("Please enter URL", "https://wikipedia.org"); - let desc = prompt("Description", "The free Encyclopedia"); - var out = "[" + desc + "](" + url + ") "; - } - if (x == "headline") { - let headline = prompt("Headline", "Act One"); - var out = "##" + headline + "\n\n"; - } - if (x == "pic") { - let desc = prompt("Description", "Wikipedia logo"); - let pic = prompt("Please enter URL or Number", "https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png"); - var out = "![" + desc + "](" + pic + ") "; - } - if (x == "bold") { - let bold = prompt("Bold", ""); - var out = "_" + bold + "_ "; - } - if (x == "paragraph") { - var out = "\n\n"; - } - if (x == "newline") { - var out = " \n"; - } - if (x == "more") { - var out = "\n\n\n\n"; - } - if (out != null) { - document.getElementById('content').innerHTML += out; - } + const id = document.getElementById('content'); + if (x == "url") { + let url = prompt("Please enter URL", "https://wikipedia.org"); + let desc = prompt("Description", "The free Encyclopedia"); + var out = "[" + desc + "](" + url + ") "; + } + if (x == "headline") { + let headline = prompt("Headline", "Act One"); + var out = "\n## " + headline + "\n\n"; + } + if (x == "pic") { + let desc = prompt("Description", "Wikipedia logo"); + let pic = prompt("Please enter URL or Number", "https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png"); + var out = "![" + desc + "](" + pic + ") "; + } + if (x == "bold") { + let bold = prompt("Bold", ""); + var out = "\*\*" + bold + "\*\* "; + } + if (x == "paragraph") { + var out = "\n\n"; + } + if (x == "newline") { + var out = " \n"; + } + if (x == "more") { + var out = "\n\n\n"; + } + if (out != null) { + typeInTextarea(out); + const end = id.value.length; + id.setSelectionRange(end, end); + id.focus(); + } } function testor(input) { @@ -216,7 +225,7 @@ function showInput(e) { } } const textarea = document.getElementById('result'); - var end = textarea.value.length; + var end = textarea.length; textarea.focus(); }