Compare commits

...

2 Commits

Author SHA1 Message Date
da3f7c7483 better tagcloud (#328)
Reviewed-on: BgLUG/bglug.it#328
Co-authored-by: paspo <paolo@asperti.com>
Co-committed-by: paspo <paolo@asperti.com>
2024-10-31 22:08:45 +00:00
dbbe645aaf homepage-list (#329)
fixes #320

Reviewed-on: BgLUG/bglug.it#329
Co-authored-by: paspo <paolo@asperti.com>
Co-committed-by: paspo <paolo@asperti.com>
2024-10-31 22:04:28 +00:00
5 changed files with 63 additions and 24 deletions

View File

@ -211,6 +211,22 @@ article header div.author {
}
.tags-sidebar {
--font_min_rem: 16px;
--font_max_rem: 32px;
--delta: calc(var(--font_max_rem) - var(--font_min_rem));
a.font-size-0 { font-size: calc(var(--font_min_rem) + var(--delta) * 0.0 ); }
a.font-size-1 { font-size: calc(var(--font_min_rem) + var(--delta) * 0.1 ); }
a.font-size-2 { font-size: calc(var(--font_min_rem) + var(--delta) * 0.2 ); }
a.font-size-3 { font-size: calc(var(--font_min_rem) + var(--delta) * 0.3 ); }
a.font-size-4 { font-size: calc(var(--font_min_rem) + var(--delta) * 0.4 ); }
a.font-size-5 { font-size: calc(var(--font_min_rem) + var(--delta) * 0.5 ); }
a.font-size-6 { font-size: calc(var(--font_min_rem) + var(--delta) * 0.6 ); }
a.font-size-7 { font-size: calc(var(--font_min_rem) + var(--delta) * 0.7 ); }
a.font-size-8 { font-size: calc(var(--font_min_rem) + var(--delta) * 0.8 ); }
a.font-size-9 { font-size: calc(var(--font_min_rem) + var(--delta) * 0.9 ); }
a.font-size-10 { font-size: calc(var(--font_min_rem) + var(--delta) * 1.0 ); }
li.hidden {
display: none;
visibility: hidden;

View File

@ -14,9 +14,13 @@ items:
title: More information
contents: "The entrance has been moved to Via San Giovanni Bosco 16"
- heading: Latest posts and events
type: posts_homepage_grouping
type: posts_homepage
max: 6
featured_first: true
sections:
- events
- linuxday
- posts
- type: highlights
items_per_row: 2
items:

View File

@ -14,9 +14,13 @@ items:
title: Più informazioni
contents: "L'entrata è stata spostata in Via San Giovanni Bosco 16"
- heading: Ultimi post ed eventi
type: posts_homepage_grouping
type: posts_homepage
max: 6
featured_first: true
sections:
- events
- linuxday
- posts
- type: highlights
items_per_row: 2
items:

View File

@ -0,0 +1,30 @@
{{- $pages := (where .ctx.Site.RegularPages "Section" "in" .item.sections ) }}
{{- $pages := (where $pages ".Params.homepage" "ne" false ) }}
{{- if gt (len $pages) 0 }}
<section class="wrapper style1">
<div class="container">
{{ with .item.heading }}<h2>{{ . }}</h2>{{ end }}
{{ if eq .item.featured_first true }}
<div class="row">
{{- range $idx, $itm := first 1 $pages }}
{{- .Render "shortblock_wide" -}}
{{- end }}
</div>
{{- $pages = after 1 $pages }}
{{- end }}
{{- range $idx, $itm := first (.item.max | default 4) $pages }}
{{- $rowpos := mod $idx 2 }}
{{- if eq $rowpos 0 }}
<div class="row">
{{ end }}
{{- .Render "shortblock" -}}
{{ if or (eq $rowpos 1) (eq $idx (len $pages)) -}}
</div>
{{- end }}
{{- end }}
</div>
</section>
{{ end }}

View File

@ -7,46 +7,31 @@
{{ $count_min_display := 3 }}
{{ $tags := where .Site.Taxonomies.tags ".Page.Section" .Section }}
{{ $count := len $tags }}
{{ $count_min := -1 }}
{{ $count_max := -1 }}
{{/* attenzione: $num_fonts deve essere float, quindi specificare sempre i decimali */}}
{{ $num_fonts := 10.0 }}
{{ range $tags }}
{{ $c := len .Pages }}
{{ if gt $c $count_max }}
{{ $count_max = $c }}
{{ end }}
{{ if le $count_min -1 }}
{{ $count_min = $c }}
{{ end }}
{{ if lt $c $count_min }}
{{ $count_min = $c }}
{{ end }}
{{ end }}
{{ if lt $count_min $count_min_display }}
{{ $count_min = $count_min_display }}
{{ end }}
{{ if le $count_max $count_min }}
{{ $count_max = add $count_min 1 }}
{{ if le $count_max 0 }}
{{ $count_max = 1 }}
{{ end }}
{{ $count_delta := sub $count_max $count_min }}
{{ $font_delta := sub $font_max $font_min }}
{{ $font_step := div $font_delta $count_delta }}
{{/* range $tags.ByCount */}}
{{ range $tags.Alphabetical }}
{{ $c := len .Pages }}
{{ $font_size := (add $font_min (mul $c $font_step)) }}
{{ $font_size := int ( mul $c (div $num_fonts $count_max) ) }}
{{ if ge $c $count_min_display }}
<li>
<a style="font-size: {{ $font_size }}rem;" href="/{{ .Page.Lang }}{{ .Page.Path }}">{{ .Page.LinkTitle | safeHTML }} ({{ len .Pages }})</a></li>
<a class="font-size-{{ $font_size }}" href="/{{ .Page.Lang }}{{ .Page.Path }}">{{ .Page.LinkTitle | safeHTML }} ({{ len .Pages }})</a></li>
{{ else }}
<li class="hidden">
<a style="font-size: {{ $font_size }}rem;" href="/{{ .Page.Lang }}{{ .Page.Path }}">{{ .Page.LinkTitle | safeHTML }} ({{ len .Pages }})</a></li>
<a class="font-size-{{ $font_size }}" href="/{{ .Page.Lang }}{{ .Page.Path }}">{{ .Page.LinkTitle | safeHTML }} ({{ len .Pages }})</a></li>
{{ end }}
{{ end }}
<li><a id="more-tags">{{ T "more_tags" }}</a></li>