Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zwbetz-gh/minimal-bootstrap-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Betz <zwbetz@gmail.com>2018-10-23 23:37:15 +0300
committerZachary Betz <zwbetz@gmail.com>2018-10-23 23:37:15 +0300
commit578e4c1e80f63c13bfcc11d79e53d619342dcdf5 (patch)
tree4a46c358e5654d33dae2cd28c03023e3f9ed60ba
parent0ce9afe1f38e98b00e5ca3f872ee0728d7c37e7b (diff)
Add config option for Google Font Roboto
-rw-r--r--README.md14
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/partials/head.html4
-rw-r--r--layouts/partials/style.html13
4 files changed, 31 insertions, 1 deletions
diff --git a/README.md b/README.md
index 9196eee..cfc5af7 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,8 @@ The typical page size, if the page has no images, is under 300kb (even lower if
* Bootstrap CSS
* Favicon (if enabled)
* Google Analytics JS (if enabled)
-* Cookie Consent CSS/JS (if enabled)
+* Cookie Consent CSS/JS (if enabled)
+* Google Roboto Font (if enabled)
## Table of Contents
@@ -38,6 +39,7 @@ The typical page size, if the page has no images, is under 300kb (even lower if
* [Google Analytics](#google-analytics)
* [Cookie Consent](#cookie-consent)
* [Include Bootstrap JS](#include-bootstrap-js)
+ * [Google Font Roboto](#google-font-roboto)
* [Favicon Colors on Various Platforms](#favicon-colors-on-various-platforms)
* [Menu Nav](#menu-nav)
* [Favicon and Apple Touch Icon](#favicon-and-apple-touch-icon)
@@ -137,6 +139,7 @@ pygmentsStyle = "pygments"
googleAnalytics = "UA-123456789-1"
cookieConsent = true
includeBootstrapJs = false
+ googleFontRoboto = true
faviconSafariPinnedTabColor = "#5bbad5"
faviconMsApplicationTileColor = "#da532c"
@@ -319,6 +322,15 @@ includeBootstrapJs = false
* If set to `true`, this will include the Bootstrap JS scripts (they are not included by default)
* This is only necessary if you plan to override the theme and need to use Bootstrap functionality that requires its JS scripts
+### Google Font Roboto
+
+```
+googleFontRoboto = true
+```
+* Optional
+* If set to `true`, this will use the Google Font Roboto
+* If set to `false`, or if not present, the default Bootstrap [native font stack](https://getbootstrap.com/docs/4.1/content/reboot/#native-font-stack) will be used
+
### Favicon Colors on Various Platforms
```
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 285d9d2..dda76dd 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -24,6 +24,7 @@ enableGitInfo = false
googleAnalytics = "UA-123456789-1"
cookieConsent = true
includeBootstrapJs = false
+ googleFontRoboto = true
faviconSafariPinnedTabColor = "#5bbad5"
faviconMsApplicationTileColor = "#da532c"
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 951fdc4..2ad06e4 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -28,6 +28,10 @@
{{ $bootstrapCss := "css/bootstrap.min.css" }}
<link rel="stylesheet" href="{{ $bootstrapCss | absURL }}" />
+ {{ if eq .Site.Params.googleFontRoboto true }}
+ <link href="https://fonts.googleapis.com/css?family=Roboto:400,400i,700,700i" rel="stylesheet">
+ {{ end }}
+
{{ if .IsHome }}
{{ $homepage := "" }}{{ range first 1 .Site.Menus.nav }}{{ $homepage = .Name }}{{ end }}
<title>{{ $homepage }} | {{ .Site.Title }}</title>
diff --git a/layouts/partials/style.html b/layouts/partials/style.html
index 5938cc9..89020d7 100644
--- a/layouts/partials/style.html
+++ b/layouts/partials/style.html
@@ -158,4 +158,17 @@ blockquote,
border-left: 5px solid #6c757d;
}
{{ end }}
+
+{{ if eq .Site.Params.googleFontRoboto true }}
+html,
+body,
+code,
+kbd,
+pre,
+samp,
+.tooltip
+.popover {
+ font-family: 'Roboto', sans-serif;
+}
+{{ end }}
</style> \ No newline at end of file