From 2b6cbdecb3caae18126e80275078d2c8a8a2ab6a Mon Sep 17 00:00:00 2001 From: Edoardo Rosa <6991986+notdodo@users.noreply.github.com> Date: Sun, 3 Dec 2023 16:35:31 +0100 Subject: [PATCH] enh: slim baseof template; add new partials for matches --- layouts/_default/baseof.html | 71 +++----------------------------- layouts/partials/last-match.html | 35 ++++++++++++++++ layouts/partials/next-match.html | 35 ++++++++++++++++ layouts/partials/sponsors.html | 47 +++++++++++++++++++++ layouts/partials/video.html | 19 +++++++++ 5 files changed, 141 insertions(+), 66 deletions(-) create mode 100644 layouts/partials/last-match.html create mode 100644 layouts/partials/next-match.html create mode 100644 layouts/partials/sponsors.html create mode 100644 layouts/partials/video.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index b2f83079..203decca 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -16,76 +16,15 @@ {{ partial "partials/header/basic.html" . }} {{ end }} {{ if .IsHome }} - {{ if .Site.Params.homePageVideo }} - -
- -
- {{ end }} + {{- partial "video.html" . -}} {{ end }} -
-
+
{{ if .IsHome }} -

Sponsors

- {{ $images := .Site.Params.sponsors }} - - -
-
- {{ $num := 0 }} - {{ range $images }} -
-
- - {{ if .site }} - {{ .img }} - {{ else }} - {{ .img }} - {{ end }} - - {{ if .name }} -

{{ .name }}

- {{ end }} -
-
- {{ $num = add $num 1 }} - {{ end }} - {{ $num := 0 }} - {{ range $images }} -
-
- - {{ if .site }} - {{ .img }} - {{ else }} - {{ .img }} - {{ end }} - - {{ if .name }} -
-

{{ .name }}

-
- {{ end }} -
-
- {{ $num = add $num 1 }} - {{ end }} -
-
+ {{- partial "sponsors.html" . -}} + {{- partial "next-match.html" . -}} + {{- partial "last-match.html" . -}} {{ end }} {{ block "main" . }}{{ end }} {{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 1) }} diff --git a/layouts/partials/last-match.html b/layouts/partials/last-match.html new file mode 100644 index 00000000..a0b0f891 --- /dev/null +++ b/layouts/partials/last-match.html @@ -0,0 +1,35 @@ +

Ultima Partita

+{{ $match := .Site.Params.last_match }} +
+
+ +
+ +
+ {{ if strings.Contains $match.home "Saviors" }} +

{{ $match.home }}

+ {{ else }} +

{{ $match.home }}

+ {{ end }} +
+ +
+

{{ $match.result }}

+
+ +
+ {{ if strings.Contains $match.visitors "Saviors" }} +

{{ $match.visitors }}

+ {{ else }} +

{{ $match.visitors }}

+ {{ end }} +
+ +
+ +
+
+
+
+

{{ $match.when_where }}

+
\ No newline at end of file diff --git a/layouts/partials/next-match.html b/layouts/partials/next-match.html new file mode 100644 index 00000000..4c8e9dca --- /dev/null +++ b/layouts/partials/next-match.html @@ -0,0 +1,35 @@ +

Prossima Partita

+{{ $match := .Site.Params.next_match }} +
+
+ +
+ +
+ {{ if strings.Contains $match.home "Saviors" }} +

{{ $match.home }}

+ {{ else }} +

{{ $match.home }}

+ {{ end }} +
+ +
+

{{ $match.result }}

+
+ +
+ {{ if strings.Contains $match.visitors "Saviors" }} +

{{ $match.visitors }}

+ {{ else }} +

{{ $match.visitors }}

+ {{ end }} +
+ +
+ +
+
+
+
+

{{ $match.when_where }}

+
\ No newline at end of file diff --git a/layouts/partials/sponsors.html b/layouts/partials/sponsors.html new file mode 100644 index 00000000..daee3916 --- /dev/null +++ b/layouts/partials/sponsors.html @@ -0,0 +1,47 @@ +

Sponsors

+{{ $images := .Site.Params.sponsors }} + + +
+
+ {{ $num := 0 }} {{ range $images }} +
+
+ + {{ if .site }} + {{ .img }} + {{ else }} + {{ .img }} + {{ end }} + + {{ if .name }} +
+

{{ .name }}

+
+ {{ end }} +
+
+ {{ $num = add $num 1 }} {{ end }} {{ $num := 0 }} {{ range $images }} +
+
+ + {{ if .site }} + {{ .img }} + {{ else }} + {{ .img }} + {{ end }} + + {{ if .name }} +
+

{{ .name }}

+
+ {{ end }} +
+
+ {{ $num = add $num 1 }} {{ end }} +
+
diff --git a/layouts/partials/video.html b/layouts/partials/video.html new file mode 100644 index 00000000..53d2446e --- /dev/null +++ b/layouts/partials/video.html @@ -0,0 +1,19 @@ +{{ if .Site.Params.homePageVideo }} + +
+ +
+
+{{ end }}