From 2b18014fd0aa99e9f1a5610ba875101351a90de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 7 Mar 2018 12:25:49 +0100 Subject: [PATCH] Squashed 'themes/gohugoioTheme/' changes from fe71e360..396b859f 396b859f Remove console.log from the ga partial bd0d5ea1 Send custom dimensions in GA 4c4f13a7 Fix broken gtag 3fcf17e6 Add site to GA config d50c77c2 Add branch to GA config 261def30 Add new sponsor b706e805 updated to new Forestry logo 8e414ca6 GA track outgoing sponsor clikcs e9bc3550 Move the sponsor banners up a little ff619669 Migrate from analytics.js to gtag.js f045b912 Add fluid type to showcase details box d1865f3e Adjust column widths to handle a wider variety of copy width 877d4baa Always show the latest showcase item on front page 44cdbac1 showcase: Shuffle the news items 5efcb135 Trim "www." from shocase URLs in title ae61a4c4 Make the inline showcase template names unique 2fc7e154 Add a Showcase copyright notice git-subtree-dir: themes/gohugoioTheme git-subtree-split: 396b859f10615e8069d9acec31a2e79e39e05c50 --- data/sponsors.toml | 6 +-- layouts/_default/baseof.html | 2 +- layouts/index.html | 6 +-- layouts/partials/gtag.html | 26 ++++++++++ .../partials/home-page-sections/showcase.html | 49 ++++++++++-------- .../partials/home-page-sections/sponsors.html | 12 ++++- layouts/partials/site-footer.html | 2 +- layouts/showcase/list.html | 3 +- layouts/showcase/single.html | 23 ++++---- src/css/_fluid-type.css | 10 ++++ src/css/main.css | 1 + static/dist/main.css | 2 +- static/images/sponsors/forestry-logotype.svg | 2 +- .../linode-logo_standard_light_medium.png | Bin 0 -> 30887 bytes 14 files changed, 99 insertions(+), 45 deletions(-) create mode 100644 layouts/partials/gtag.html create mode 100644 src/css/_fluid-type.css create mode 100644 static/images/sponsors/linode-logo_standard_light_medium.png 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"}} -