From 2ce211c2260a70ea87f68b3e1e1bc60f1bc651f3 Mon Sep 17 00:00:00 2001 From: Sascha Brendel Date: Sat, 15 Sep 2018 09:48:51 +0200 Subject: [PATCH 1/2] Added configuration options to the style. Fixed font path issues. Fixed #109 #114 #115. --- assets/sass/_variables.scss | 4 ++-- assets/sass/theme.scss | 3 ++- exampleSite/config.toml | 4 ++++ layouts/_default/baseof.html | 9 ++++++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/assets/sass/_variables.scss b/assets/sass/_variables.scss index aeb220d16..6e96ef5a3 100644 --- a/assets/sass/_variables.scss +++ b/assets/sass/_variables.scss @@ -1,8 +1,8 @@ -$fonts-folder: '/bilberry-hugo-theme/dist/fonts/'; +$fonts-folder: '{{ .Site.BaseURL }}/dist/fonts/'; // Set the with of the main content area // Notice that the actual content's width is $site-width - 100px -$site-width: 800px; +$site-width: {{ .Site.Params.SiteWidth | default "800px" }}; // Define your fonts. // If you want to import new fonts, set them in /src/css/fonts.css diff --git a/assets/sass/theme.scss b/assets/sass/theme.scss index 3c2bcfc2a..00da3fef0 100644 --- a/assets/sass/theme.scss +++ b/assets/sass/theme.scss @@ -1,4 +1,4 @@ -@import "_variables"; +// @import "_variables"; @import "externalDependencies"; @import "fontface"; @@ -29,6 +29,7 @@ .container { width: $site-width; + max-width: 100%; } @import "topnav"; diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 413c7c145..8f75d4681 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -43,6 +43,10 @@ disqusShortname = "bilberry-hugo-theme" # Set this option to false if you want to search within all articles in all languages at once algolia_currentLanguageOnly = true + # Style configuration + # set the width of your site's content + siteWidth = "800px" + # Header configuration # your subtitle if you want to use any subtitle = "Hello World! This is the most epic subtitle ever." diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index e4c7f32ac..7f5ea4728 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -53,7 +53,10 @@ {{ end }} - {{ $style := resources.Get "sass/theme.scss" | toCSS | minify | fingerprint }} + {{ $variables := resources.Get "sass/_variables.scss" | resources.ExecuteAsTemplate "sass/variables.scss" . }} + {{ $theme := resources.Get "sass/theme.scss" }} + {{ $combined := slice $variables $theme | resources.Concat "sass/combined.scss" }} + {{ $style := $combined | toCSS | minify | fingerprint }} {{ partial "twitter-card" . }} @@ -82,11 +85,11 @@ {{ end }} {{ $js := resources.Get "js/externalDependencies.js" }} - {{ $secureJS := $js | resources.Fingerprint "sha512" }} + {{ $secureJS := $js | resources.Fingerprint "md5" }} {{ $jsTemplate := resources.Get "js/theme.js" }} - {{ $secureJS := $jsTemplate | resources.ExecuteAsTemplate "js/theme.js" . | fingerprint }} + {{ $secureJS := $jsTemplate | resources.ExecuteAsTemplate "js/theme.js" . | fingerprint "md5" }}