From af3e8fb2031296124465161cb3ba8816535be092 Mon Sep 17 00:00:00 2001 From: Nathan Biller Date: Tue, 24 Sep 2019 12:39:27 -0400 Subject: [PATCH 1/4] Added the ability to use google analytics using Hugo's internal template. Added a sample config and instructions to config.yaml for the example site and added in a link for the google analytics internal template for the navbar partial per https://gohugo.io/templates/internal/ --- exampleSite/config.yaml | 1 + layouts/partials/navbar.html | 1 + 2 files changed, 2 insertions(+) diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index a37018c..83f6c95 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -2,6 +2,7 @@ baseURL: http://something-fresh.org/ languageCode: en-us title: Hugo Fresh Theme theme: hugo-fresh +googleAnalytics: #Put in your tracking code without quotes like this: UA-XXXXXX... params: navbarlogo: diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 93e93e6..456c1e8 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -1,3 +1,4 @@ +{{ template "_internal/google_analytics_async.html" . }} {{- $navbar := .Site.Params.navbar }} {{- $sidebarVisible := .Site.Params.sidebar }} {{ if .Params.sidebar }} From 0ddd19f36e8932292d4f70749c3d8e05472765c0 Mon Sep 17 00:00:00 2001 From: Nathan Biller Date: Tue, 24 Sep 2019 13:10:54 -0400 Subject: [PATCH 2/4] Moved code to component versus the navbar as advised by @lucperkins --- layouts/partials/meta.html | 1 + layouts/partials/navbar.html | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index eac0aa3..b894f4d 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -1,3 +1,4 @@ +{{ template "_internal/google_analytics_async.html" . }} \ No newline at end of file diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 456c1e8..93e93e6 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -1,4 +1,3 @@ -{{ template "_internal/google_analytics_async.html" . }} {{- $navbar := .Site.Params.navbar }} {{- $sidebarVisible := .Site.Params.sidebar }} {{ if .Params.sidebar }} From 3ec8032f538fcef00c848420e5eeb4c040758fd2 Mon Sep 17 00:00:00 2001 From: Stefan M Date: Wed, 25 Sep 2019 08:45:28 +0200 Subject: [PATCH 3/4] Fix CI for pull-requests --- .circleci/config.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0edf2f8..acb4db1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,10 +22,13 @@ jobs: - run: working_directory: my-site/themes/hugo-fresh command: | - if [[ ${CIRCLE_BRANCH} == "*pull*" ]]; then + isPrIfGreaterThanZero=$(expr $CIRCLE_BRANCH : "pull") + if [ isPrIfGreaterThanZero > 0 ]; then + echo "Hello World $CIRCLE_BRANCH" git fetch origin ${CIRCLE_BRANCH}/head:BRANCHNAME git checkout BRANCHNAME else + echo "Hello World else $CIRCLE_BRANCH" git checkout ${CIRCLE_BRANCH} fi @@ -33,9 +36,9 @@ jobs: name: Replace default config working_directory: my-site command: | - if [[ ${CIRCLE_BRANCH} == "*pull*" ]]; then - git fetch origin ${CIRCLE_BRANCH}/head:BRANCHNAME - branch=BRANCHNAME + isPrIfGreaterThanZero=$(expr $CIRCLE_BRANCH : "pull") + if [ isPrIfGreaterThanZero > 0 ]; then + branch=${CIRCLE_SHA1} else branch=${CIRCLE_BRANCH} fi @@ -47,7 +50,7 @@ jobs: working_directory: my-site command: | apk add sed - URL=hugo-fresh-$(echo $CIRCLE_BRANCH | tr _ -) + URL=hugo-fresh-$(echo $CIRCLE_BRANCH | tr _ - | tr / -) if [ $CIRCLE_BRANCH == "master" ]; then URL=hugo-fresh fi @@ -63,7 +66,7 @@ jobs: name: Create now.json working_directory: my-site/public command: | - URL=hugo-fresh-$(echo $CIRCLE_BRANCH | tr _ -) + URL=hugo-fresh-$(echo $CIRCLE_BRANCH | tr _ - | tr / -) if [ $CIRCLE_BRANCH == "master" ]; then URL=hugo-fresh fi From 06c4f06613798d9d5883a620bdb80e193cdc9796 Mon Sep 17 00:00:00 2001 From: Nathan Biller Date: Wed, 25 Sep 2019 02:01:06 -0400 Subject: [PATCH 4/4] Corrected the overlapping issue of section 3 on section 2 by decreasing the viewport height. --- assets/fresh/partials/_sections.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/fresh/partials/_sections.scss b/assets/fresh/partials/_sections.scss index 763071d..80f3197 100644 --- a/assets/fresh/partials/_sections.scss +++ b/assets/fresh/partials/_sections.scss @@ -61,7 +61,7 @@ Section Styles //Pulled image img.pushed-image { - margin-top: -29vh; + margin-top: -8vh; } //Icon box