forked from BgLUG/bglug.it
Compare commits
2 Commits
58894ae249
...
da3f7c7483
Author | SHA1 | Date | |
---|---|---|---|
da3f7c7483 | |||
dbbe645aaf |
@ -211,6 +211,22 @@ article header div.author {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tags-sidebar {
|
.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 {
|
li.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
|
@ -14,9 +14,13 @@ items:
|
|||||||
title: More information
|
title: More information
|
||||||
contents: "The entrance has been moved to Via San Giovanni Bosco 16"
|
contents: "The entrance has been moved to Via San Giovanni Bosco 16"
|
||||||
- heading: Latest posts and events
|
- heading: Latest posts and events
|
||||||
type: posts_homepage_grouping
|
type: posts_homepage
|
||||||
max: 6
|
max: 6
|
||||||
featured_first: true
|
featured_first: true
|
||||||
|
sections:
|
||||||
|
- events
|
||||||
|
- linuxday
|
||||||
|
- posts
|
||||||
- type: highlights
|
- type: highlights
|
||||||
items_per_row: 2
|
items_per_row: 2
|
||||||
items:
|
items:
|
||||||
|
@ -14,9 +14,13 @@ items:
|
|||||||
title: Più informazioni
|
title: Più informazioni
|
||||||
contents: "L'entrata è stata spostata in Via San Giovanni Bosco 16"
|
contents: "L'entrata è stata spostata in Via San Giovanni Bosco 16"
|
||||||
- heading: Ultimi post ed eventi
|
- heading: Ultimi post ed eventi
|
||||||
type: posts_homepage_grouping
|
type: posts_homepage
|
||||||
max: 6
|
max: 6
|
||||||
featured_first: true
|
featured_first: true
|
||||||
|
sections:
|
||||||
|
- events
|
||||||
|
- linuxday
|
||||||
|
- posts
|
||||||
- type: highlights
|
- type: highlights
|
||||||
items_per_row: 2
|
items_per_row: 2
|
||||||
items:
|
items:
|
||||||
|
30
layouts/partials/homepage/blocks/posts_homepage.html
Normal file
30
layouts/partials/homepage/blocks/posts_homepage.html
Normal 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 }}
|
@ -7,46 +7,31 @@
|
|||||||
{{ $count_min_display := 3 }}
|
{{ $count_min_display := 3 }}
|
||||||
|
|
||||||
{{ $tags := where .Site.Taxonomies.tags ".Page.Section" .Section }}
|
{{ $tags := where .Site.Taxonomies.tags ".Page.Section" .Section }}
|
||||||
{{ $count := len $tags }}
|
|
||||||
|
|
||||||
{{ $count_min := -1 }}
|
|
||||||
{{ $count_max := -1 }}
|
{{ $count_max := -1 }}
|
||||||
|
{{/* attenzione: $num_fonts deve essere float, quindi specificare sempre i decimali */}}
|
||||||
|
{{ $num_fonts := 10.0 }}
|
||||||
|
|
||||||
{{ range $tags }}
|
{{ range $tags }}
|
||||||
{{ $c := len .Pages }}
|
{{ $c := len .Pages }}
|
||||||
{{ if gt $c $count_max }}
|
{{ if gt $c $count_max }}
|
||||||
{{ $count_max = $c }}
|
{{ $count_max = $c }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if le $count_min -1 }}
|
|
||||||
{{ $count_min = $c }}
|
|
||||||
{{ end }}
|
|
||||||
{{ if lt $c $count_min }}
|
|
||||||
{{ $count_min = $c }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if lt $count_min $count_min_display }}
|
{{ if le $count_max 0 }}
|
||||||
{{ $count_min = $count_min_display }}
|
{{ $count_max = 1 }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if le $count_max $count_min }}
|
|
||||||
{{ $count_max = add $count_min 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.ByCount */}}
|
||||||
{{ range $tags.Alphabetical }}
|
{{ range $tags.Alphabetical }}
|
||||||
{{ $c := len .Pages }}
|
{{ $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 }}
|
{{ if ge $c $count_min_display }}
|
||||||
<li>
|
<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 }}
|
{{ else }}
|
||||||
<li class="hidden">
|
<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 }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<li><a id="more-tags">{{ T "more_tags" }}</a></li>
|
<li><a id="more-tags">{{ T "more_tags" }}</a></li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user