diff --git a/data/sponsors.toml b/data/sponsors.toml index 03e89745f..5e35a25dc 100644 --- a/data/sponsors.toml +++ b/data/sponsors.toml @@ -5,9 +5,9 @@ logo = "/images/sponsors/forestry-logotype.svg" copy = "" [[banners]] -name = "" -link = "" -logo = "" +name = "Linode" +link = "https://www.linode.com/" +logo = "/images/sponsors/linode-logo_standard_light_medium.png" copy = "" [[banners]] diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index b7ad4f10e..3a0a9f7f2 100755 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -34,7 +34,7 @@ {{- template "_internal/twitter_cards.html" . -}} {{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} - {{ template "_internal/google_analytics_async.html" . }} + {{ partial "gtag" . }} {{ end }} diff --git a/layouts/index.html b/layouts/index.html index 9dcee424d..2f9364c8c 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -9,16 +9,16 @@ {{- partial "home-page-sections/features-icons" . -}} - {{- partial "home-page-sections/showcase.html" . -}} + {{ partial "home-page-sections/sponsors.html" (dict "cx" . "gtag" "home" ) }} {{- partial "home-page-sections/features-single" . -}} + {{- partial "home-page-sections/showcase.html" . -}} +
{{- partial "home-page-sections/installation" . -}}
- {{ partial "home-page-sections/sponsors.html" (dict "cx" . ) }} -
{{- partial "home-page-sections/tweets" . -}}
diff --git a/layouts/partials/gtag.html b/layouts/partials/gtag.html new file mode 100644 index 000000000..c78926503 --- /dev/null +++ b/layouts/partials/gtag.html @@ -0,0 +1,26 @@ +{{ with .Site.GoogleAnalytics }} + + +{{ end }} \ No newline at end of file diff --git a/layouts/partials/home-page-sections/showcase.html b/layouts/partials/home-page-sections/showcase.html index 337fd2fc8..774c10e0f 100644 --- a/layouts/partials/home-page-sections/showcase.html +++ b/layouts/partials/home-page-sections/showcase.html @@ -4,26 +4,10 @@
- {{ range $p := first 10 (where .Site.RegularPages "Section" "showcase") }} - {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} - {{ with $img }} - {{ $big := .Fill "1024x512 top" }} - {{ $small := $big.Resize "512x" }} - - {{with $p.Title}} -
-
- {{.}} → -
-
- {{end}} -
- {{ end }} + {{ $showcasePages := where .Site.RegularPages "Section" "showcase" }} + {{ template "home_showcase_item" (index $showcasePages 0) }} + {{ range $p := first 10 ($showcasePages | after 1 | shuffle) }} + {{template "home_showcase_item" $p }} {{end}}
@@ -32,4 +16,27 @@
{{/* using Flex to make the button show up on the right side */}} See All
- \ No newline at end of file + + + +{{ define "home_showcase_item" }} + {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} + {{ with $img }} + {{ $big := .Fill "1024x512 top" }} + {{ $small := $big.Resize "512x" }} + + {{with $.Title}} +
+
+ {{.}} → +
+
+ {{end}} +
+ {{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/home-page-sections/sponsors.html b/layouts/partials/home-page-sections/sponsors.html index 4d32fc5d6..95f7ecfdb 100644 --- a/layouts/partials/home-page-sections/sponsors.html +++ b/layouts/partials/home-page-sections/sponsors.html @@ -1,14 +1,22 @@ {{$classes_box := "ba b--light-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l "}} +{{$gtag := .gtag | default "unknown" }} {{ with .cx.Site.Data.sponsors }} -
+
  Hugo Sponsors
{{ range .banners }} + {{ $banner := . }} {{if .logo}}
{{with .link -}} - + {{ $url := printf "%s?%s" . (querify "utm_source" "homepage" "utm_medium" "banner" "utm_campaign" "hugosponsor") | safeURL }} + {{ if eq (getenv "HUGO_ENV") "production" | or (eq $.cx.Site.Params.env "production") }} + {{ $gtagID := printf "Sponsor %s %s" $banner.name $gtag | title }} + + {{ else }} + + {{ end }} {{- end}} Logo for {{ .name }} {{with .link}}{{end}} diff --git a/layouts/partials/site-footer.html b/layouts/partials/site-footer.html index ef32025eb..771ec348f 100755 --- a/layouts/partials/site-footer.html +++ b/layouts/partials/site-footer.html @@ -29,7 +29,7 @@
  - {{ partial "home-page-sections/sponsors.html" (dict "cx" . "classes_section" "pb3 w-100" "classes_copy" "f7 w-90-ns") }} + {{ partial "home-page-sections/sponsors.html" (dict "cx" . "gtag" "footer" "classes_section" "pb3 w-100" "classes_copy" "f7 w-90-ns") }}
diff --git a/layouts/showcase/list.html b/layouts/showcase/list.html index 709219947..b0083fc0f 100644 --- a/layouts/showcase/list.html +++ b/layouts/showcase/list.html @@ -9,7 +9,7 @@
- {{ range (.Paginator 20).Pages }} + {{ range (.Paginate (.Pages | shuffle ) 20).Pages }} {{template "showcase_items" .}} {{ end }}
@@ -17,6 +17,7 @@ {{/* pagination.html: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/template_embedded.go#L117 */}} {{ template "_internal/pagination.html" . }}
+
The Showcase articles are copyright the content authors. Any open source license will be attached.
{{ end }} diff --git a/layouts/showcase/single.html b/layouts/showcase/single.html index c3e15127e..0d92c4cdc 100644 --- a/layouts/showcase/single.html +++ b/layouts/showcase/single.html @@ -9,15 +9,15 @@ Showcase: {{ .Title }}
- {{template "details" .}} + {{template "sc-details" .}}
-
- {{template "main-column" .}} +
+ {{template "sc-main-column" .}}
@@ -26,13 +26,13 @@ Showcase: {{ .Title }} Last Update: {{ .Lastmod.Format "January 2, 2006" }}
{{ partial "page-edit.html" . }}
- +
The Showcase articles are copyright the content authors. Any open source license will be attached.
{{ end }} -{{define "main-column"}} +{{define "sc-main-column"}} {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} {{ with $img }} {{ $big := .Fill "1024x512 top" }} @@ -47,14 +47,15 @@ Showcase: {{ .Title }} {{- . -}} {{end}} + {{end}} -{{define "details"}} -