diff options
author | Zachary Betz <zwbetz@gmail.com> | 2018-10-23 23:37:15 +0300 |
---|---|---|
committer | Zachary Betz <zwbetz@gmail.com> | 2018-10-23 23:37:15 +0300 |
commit | 578e4c1e80f63c13bfcc11d79e53d619342dcdf5 (patch) | |
tree | 4a46c358e5654d33dae2cd28c03023e3f9ed60ba | |
parent | 0ce9afe1f38e98b00e5ca3f872ee0728d7c37e7b (diff) |
Add config option for Google Font Roboto
-rw-r--r-- | README.md | 14 | ||||
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/partials/head.html | 4 | ||||
-rw-r--r-- | layouts/partials/style.html | 13 |
4 files changed, 31 insertions, 1 deletions
@@ -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 |