From 2464e17400538c677e08061810837b1c85526ee0 Mon Sep 17 00:00:00 2001 From: rlemaitre Date: Sat, 23 May 2020 23:52:46 +0200 Subject: [PATCH 1/6] parameterize font in sass Use resources.ExecuteAsTemplate (introduced inn hugo 0.43) to use config variables in SASS. Unfortunately, only base SASS files can be used as Go template, that's why the variable is defined in main file instead of partials --- assets/fresh/partials/_buttons.scss | 4 ++-- assets/fresh/partials/_cards.scss | 2 +- assets/fresh/partials/_hero.scss | 2 +- assets/fresh/partials/_sections.scss | 4 ++-- assets/fresh/partials/_sidebar.scss | 2 +- assets/style.sass | 6 ++++++ layouts/partials/css.html | 5 +++-- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/assets/fresh/partials/_buttons.scss b/assets/fresh/partials/_buttons.scss index bb4f3e08..e385a16b 100644 --- a/assets/fresh/partials/_buttons.scss +++ b/assets/fresh/partials/_buttons.scss @@ -8,7 +8,7 @@ Classes to change the feel of bulma buttons cursor: pointer; transition: all 0.5s; &.cta { - font-family: 'Open Sans', sans-serif; + font-family: Sfont-stack; font-size: 1rem; font-weight: 600; padding: 26px 40px 26px 40px; @@ -29,7 +29,7 @@ Classes to change the feel of bulma buttons &.signup-button { font-size: .9rem; font-weight: 600; - font-family: 'Open Sans', sans-serif; + font-family: Sfont-stack; padding: 24px 26px; width: 130px; } diff --git a/assets/fresh/partials/_cards.scss b/assets/fresh/partials/_cards.scss index 57242a13..d1cafd8b 100644 --- a/assets/fresh/partials/_cards.scss +++ b/assets/fresh/partials/_cards.scss @@ -12,7 +12,7 @@ Cards and Card content styles border-radius: 3px; margin: 0 auto; .card-title h4 { - font-family: 'Open Sans', sans-serif; + font-family: Sfont-stack; padding-top: 25px; font-size: 1.2rem; font-weight: 600; diff --git a/assets/fresh/partials/_hero.scss b/assets/fresh/partials/_hero.scss index b527aedf..5e27c451 100644 --- a/assets/fresh/partials/_hero.scss +++ b/assets/fresh/partials/_hero.scss @@ -6,7 +6,7 @@ Hero styles padding-top: 6rem; padding-bottom: 6rem; .title, .subtitle { - font-family: 'Open Sans', sans-serif; + font-family: Sfont-stack; } .title { &.is-bold { diff --git a/assets/fresh/partials/_sections.scss b/assets/fresh/partials/_sections.scss index 75808ebc..04c39656 100644 --- a/assets/fresh/partials/_sections.scss +++ b/assets/fresh/partials/_sections.scss @@ -17,7 +17,7 @@ Section Styles height: 75vh !important; } .title, .subtitle { - font-family: 'Open Sans', sans-serif; + font-family: Sfont-stack; } .subtitle { @@ -32,7 +32,7 @@ Section Styles max-width: 500px; margin: 0 auto; .title, .subtitle { - font-family: 'Open Sans', sans-serif; + font-family: Sfont-stack; } .subtitle { diff --git a/assets/fresh/partials/_sidebar.scss b/assets/fresh/partials/_sidebar.scss index 2b0b48d6..537f8584 100644 --- a/assets/fresh/partials/_sidebar.scss +++ b/assets/fresh/partials/_sidebar.scss @@ -115,7 +115,7 @@ Sidebar Styles max-width: 400px; list-style: none; list-style-type: none; - font-family: 'Open Sans', sans-serif !important; + font-family: Sfont-stack !important; li { a { padding: 20px 25px; diff --git a/assets/style.sass b/assets/style.sass index b9b1d830..e3357fcd 100644 --- a/assets/style.sass +++ b/assets/style.sass @@ -1,2 +1,8 @@ +// ========================================================================== +// Parameterized variables +// ========================================================================== + +$font-stack: '{{ .Site.Params.font.name | default "Open Sans" }}', sans-serif + @import "bulma/bulma" @import "fresh/core" \ No newline at end of file diff --git a/layouts/partials/css.html b/layouts/partials/css.html index e941ba13..da3e5682 100644 --- a/layouts/partials/css.html +++ b/layouts/partials/css.html @@ -1,5 +1,6 @@ {{- $inServerMode := .Site.IsServer }} {{- $sass := "style.sass" }} +{{- $sassTemplate := "style.$sass" }} {{- $cssTarget := "css/style.css" }} {{- $cssOpts := cond ($inServerMode) (dict "targetPath" $cssTarget "enableSourceMap" true) (dict "targetPath" $cssTarget "outputStyle" "compressed") }} {{- $fontName := .Site.Params.font.name | default "Open Sans" }} @@ -9,10 +10,10 @@ {{- if $inServerMode }} -{{- $css := resources.Get $sass | toCSS $cssOpts }} +{{- $css := resources.Get $sass | resources.ExecuteAsTemplate $sassTemplate . | toCSS $cssOpts }} {{- else }} -{{- $css := resources.Get $sass | toCSS $cssOpts | minify | fingerprint }} +{{- $css := resources.Get $sass | resources.ExecuteAsTemplate $sassTemplate . | toCSS $cssOpts | minify | fingerprint }} {{- end }} From 6bd74c965b19dfdd58bc3f35cfb5cbc7ae59998c Mon Sep 17 00:00:00 2001 From: rlemaitre Date: Sun, 24 May 2020 00:14:10 +0200 Subject: [PATCH 2/6] Use Hugo 0.63.2 in circle CI --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53328ddd..c9333736 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,9 +9,9 @@ jobs: name: Install hugo command: | apk add wget - wget -q https://github.com/gohugoio/hugo/releases/download/v0.58.3/hugo_0.58.3_Linux-64bit.tar.gz + wget -q https://github.com/gohugoio/hugo/releases/download/v0.63.2/hugo_0.63.2_Linux-64bit.tar.gz apk add tar - tar xzf hugo_0.58.3_Linux-64bit.tar.gz + tar xzf hugo_0.63.2_Linux-64bit.tar.gz chmod a+x hugo mv hugo /usr/local/bin/hugo From 0dcd05c186d7df7db01b4ac8277806b5b16198f2 Mon Sep 17 00:00:00 2001 From: rlemaitre Date: Sun, 24 May 2020 00:19:12 +0200 Subject: [PATCH 3/6] Use Hugo extended in Circle CI --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c9333736..43f80e7e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,7 @@ jobs: name: Install hugo command: | apk add wget - wget -q https://github.com/gohugoio/hugo/releases/download/v0.63.2/hugo_0.63.2_Linux-64bit.tar.gz + wget -q https://github.com/gohugoio/hugo/releases/download/v0.63.2/hugo_extended_0.63.2_Linux-64bit.tar.gz apk add tar tar xzf hugo_0.63.2_Linux-64bit.tar.gz chmod a+x hugo From 0979e81c9d80fda2976d0a9d1f3b2870276213c1 Mon Sep 17 00:00:00 2001 From: rlemaitre Date: Sun, 24 May 2020 00:23:22 +0200 Subject: [PATCH 4/6] Fix hugo installation in CI --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 43f80e7e..31279260 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ jobs: apk add wget wget -q https://github.com/gohugoio/hugo/releases/download/v0.63.2/hugo_extended_0.63.2_Linux-64bit.tar.gz apk add tar - tar xzf hugo_0.63.2_Linux-64bit.tar.gz + tar xzf hugo_extended_0.63.2_Linux-64bit.tar.gz chmod a+x hugo mv hugo /usr/local/bin/hugo From 44053dbffb608fc78c07e6303526220e634d0f19 Mon Sep 17 00:00:00 2001 From: rlemaitre Date: Sun, 24 May 2020 01:02:06 +0200 Subject: [PATCH 5/6] Use absolute path to hugo in CI --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 31279260..f2a66da4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ jobs: - run: name: Create site - command: hugo new site my-site + command: /usr/local/bin/hugo new site my-site - run: name: Clone the theme from the PR @@ -70,7 +70,7 @@ jobs: - run: name: Create hugo site working_directory: my-site - command: hugo + command: /usr/local/bin/hugo - run: name: Create now.json From 3fd1c7b3668d5c2873441ef64ef19d0d5b797b9d Mon Sep 17 00:00:00 2001 From: rlemaitre Date: Sun, 11 Oct 2020 19:27:25 +0200 Subject: [PATCH 6/6] Fix typo in scss --- assets/fresh/partials/_buttons.scss | 4 ++-- assets/fresh/partials/_cards.scss | 2 +- assets/fresh/partials/_hero.scss | 2 +- assets/fresh/partials/_sections.scss | 4 ++-- assets/fresh/partials/_sidebar.scss | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/fresh/partials/_buttons.scss b/assets/fresh/partials/_buttons.scss index e385a16b..260b2417 100644 --- a/assets/fresh/partials/_buttons.scss +++ b/assets/fresh/partials/_buttons.scss @@ -8,7 +8,7 @@ Classes to change the feel of bulma buttons cursor: pointer; transition: all 0.5s; &.cta { - font-family: Sfont-stack; + font-family: $font-stack; font-size: 1rem; font-weight: 600; padding: 26px 40px 26px 40px; @@ -29,7 +29,7 @@ Classes to change the feel of bulma buttons &.signup-button { font-size: .9rem; font-weight: 600; - font-family: Sfont-stack; + font-family: $font-stack; padding: 24px 26px; width: 130px; } diff --git a/assets/fresh/partials/_cards.scss b/assets/fresh/partials/_cards.scss index d1cafd8b..45facd90 100644 --- a/assets/fresh/partials/_cards.scss +++ b/assets/fresh/partials/_cards.scss @@ -12,7 +12,7 @@ Cards and Card content styles border-radius: 3px; margin: 0 auto; .card-title h4 { - font-family: Sfont-stack; + font-family: $font-stack; padding-top: 25px; font-size: 1.2rem; font-weight: 600; diff --git a/assets/fresh/partials/_hero.scss b/assets/fresh/partials/_hero.scss index 5e27c451..e9a930ce 100644 --- a/assets/fresh/partials/_hero.scss +++ b/assets/fresh/partials/_hero.scss @@ -6,7 +6,7 @@ Hero styles padding-top: 6rem; padding-bottom: 6rem; .title, .subtitle { - font-family: Sfont-stack; + font-family: $font-stack; } .title { &.is-bold { diff --git a/assets/fresh/partials/_sections.scss b/assets/fresh/partials/_sections.scss index 04c39656..dbf147e7 100644 --- a/assets/fresh/partials/_sections.scss +++ b/assets/fresh/partials/_sections.scss @@ -17,7 +17,7 @@ Section Styles height: 75vh !important; } .title, .subtitle { - font-family: Sfont-stack; + font-family: $font-stack; } .subtitle { @@ -32,7 +32,7 @@ Section Styles max-width: 500px; margin: 0 auto; .title, .subtitle { - font-family: Sfont-stack; + font-family: $font-stack; } .subtitle { diff --git a/assets/fresh/partials/_sidebar.scss b/assets/fresh/partials/_sidebar.scss index 537f8584..9fd79c56 100644 --- a/assets/fresh/partials/_sidebar.scss +++ b/assets/fresh/partials/_sidebar.scss @@ -115,7 +115,7 @@ Sidebar Styles max-width: 400px; list-style: none; list-style-type: none; - font-family: Sfont-stack !important; + font-family: $font-stack !important; li { a { padding: 20px 25px;