From e4a97bee27c75110d983791b620dce677c44897f Mon Sep 17 00:00:00 2001 From: "V.H. Belvadi" Date: Tue, 14 May 2019 07:33:07 +0530 Subject: [PATCH] Various changes to improve local loading of Oxygen. --- assets/_fonts.scss | 48 +++++++++--------- assets/book.scss | 1 + layouts/partials/docs/html-head.html | 6 --- .../oxygen-mono-v6-latin-regular.eot | Bin .../oxygen-mono-v6-latin-regular.svg | 0 .../oxygen-mono-v6-latin-regular.ttf | Bin .../oxygen-mono-v6-latin-regular.woff | Bin .../oxygen-mono-v6-latin-regular.woff2 | Bin static/{ => fonts}/oxygen-v8-latin-300.eot | Bin static/{ => fonts}/oxygen-v8-latin-300.svg | 0 static/{ => fonts}/oxygen-v8-latin-300.ttf | Bin static/{ => fonts}/oxygen-v8-latin-300.woff | Bin static/{ => fonts}/oxygen-v8-latin-300.woff2 | Bin static/{ => fonts}/oxygen-v8-latin-700.eot | Bin static/{ => fonts}/oxygen-v8-latin-700.svg | 0 static/{ => fonts}/oxygen-v8-latin-700.ttf | Bin static/{ => fonts}/oxygen-v8-latin-700.woff | Bin static/{ => fonts}/oxygen-v8-latin-700.woff2 | Bin .../{ => fonts}/oxygen-v8-latin-regular.eot | Bin .../{ => fonts}/oxygen-v8-latin-regular.svg | 0 .../{ => fonts}/oxygen-v8-latin-regular.ttf | Bin .../{ => fonts}/oxygen-v8-latin-regular.woff | Bin .../{ => fonts}/oxygen-v8-latin-regular.woff2 | Bin 23 files changed, 25 insertions(+), 30 deletions(-) rename static/{ => fonts}/oxygen-mono-v6-latin-regular.eot (100%) rename static/{ => fonts}/oxygen-mono-v6-latin-regular.svg (100%) rename static/{ => fonts}/oxygen-mono-v6-latin-regular.ttf (100%) rename static/{ => fonts}/oxygen-mono-v6-latin-regular.woff (100%) rename static/{ => fonts}/oxygen-mono-v6-latin-regular.woff2 (100%) rename static/{ => fonts}/oxygen-v8-latin-300.eot (100%) rename static/{ => fonts}/oxygen-v8-latin-300.svg (100%) rename static/{ => fonts}/oxygen-v8-latin-300.ttf (100%) rename static/{ => fonts}/oxygen-v8-latin-300.woff (100%) rename static/{ => fonts}/oxygen-v8-latin-300.woff2 (100%) rename static/{ => fonts}/oxygen-v8-latin-700.eot (100%) rename static/{ => fonts}/oxygen-v8-latin-700.svg (100%) rename static/{ => fonts}/oxygen-v8-latin-700.ttf (100%) rename static/{ => fonts}/oxygen-v8-latin-700.woff (100%) rename static/{ => fonts}/oxygen-v8-latin-700.woff2 (100%) rename static/{ => fonts}/oxygen-v8-latin-regular.eot (100%) rename static/{ => fonts}/oxygen-v8-latin-regular.svg (100%) rename static/{ => fonts}/oxygen-v8-latin-regular.ttf (100%) rename static/{ => fonts}/oxygen-v8-latin-regular.woff (100%) rename static/{ => fonts}/oxygen-v8-latin-regular.woff2 (100%) diff --git a/assets/_fonts.scss b/assets/_fonts.scss index 549fddc..17cd664 100644 --- a/assets/_fonts.scss +++ b/assets/_fonts.scss @@ -3,50 +3,50 @@ font-family: 'Oxygen'; font-style: normal; font-weight: 300; - src: url('oxygen-v8-latin-300.eot'); /* IE9 Compat Modes */ + src: url('/fonts/oxygen-v8-latin-300.eot'); /* IE9 Compat Modes */ src: local('Oxygen Light'), local('Oxygen-Light'), - url('oxygen-v8-latin-300.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('oxygen-v8-latin-300.woff2') format('woff2'), /* Super Modern Browsers */ - url('oxygen-v8-latin-300.woff') format('woff'), /* Modern Browsers */ - url('oxygen-v8-latin-300.ttf') format('truetype'), /* Safari, Android, iOS */ - url('oxygen-v8-latin-300.svg#Oxygen') format('svg'); /* Legacy iOS */ + url('/fonts/oxygen-v8-latin-300.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('/fonts/oxygen-v8-latin-300.woff2') format('woff2'), /* Super Modern Browsers */ + url('/fonts/oxygen-v8-latin-300.woff') format('woff'), /* Modern Browsers */ + url('/fonts/oxygen-v8-latin-300.ttf') format('truetype'), /* Safari, Android, iOS */ + url('/fonts/oxygen-v8-latin-300.svg#Oxygen') format('svg'); /* Legacy iOS */ } /* oxygen-regular - latin */ @font-face { font-family: 'Oxygen'; font-style: normal; font-weight: 400; - src: url('oxygen-v8-latin-regular.eot'); /* IE9 Compat Modes */ + src: url('/fonts/oxygen-v8-latin-regular.eot'); /* IE9 Compat Modes */ src: local('Oxygen Regular'), local('Oxygen-Regular'), - url('oxygen-v8-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('oxygen-v8-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ - url('oxygen-v8-latin-regular.woff') format('woff'), /* Modern Browsers */ - url('oxygen-v8-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ - url('oxygen-v8-latin-regular.svg#Oxygen') format('svg'); /* Legacy iOS */ + url('/fonts/oxygen-v8-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('/fonts/oxygen-v8-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('/fonts/oxygen-v8-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('/fonts/oxygen-v8-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('/fonts/oxygen-v8-latin-regular.svg#Oxygen') format('svg'); /* Legacy iOS */ } /* oxygen-700 - latin */ @font-face { font-family: 'Oxygen'; font-style: normal; font-weight: 700; - src: url('oxygen-v8-latin-700.eot'); /* IE9 Compat Modes */ + src: url('/fonts/oxygen-v8-latin-700.eot'); /* IE9 Compat Modes */ src: local('Oxygen Bold'), local('Oxygen-Bold'), - url('oxygen-v8-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('oxygen-v8-latin-700.woff2') format('woff2'), /* Super Modern Browsers */ - url('oxygen-v8-latin-700.woff') format('woff'), /* Modern Browsers */ - url('oxygen-v8-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */ - url('oxygen-v8-latin-700.svg#Oxygen') format('svg'); /* Legacy iOS */ + url('/fonts/oxygen-v8-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('/fonts/oxygen-v8-latin-700.woff2') format('woff2'), /* Super Modern Browsers */ + url('/fonts/oxygen-v8-latin-700.woff') format('woff'), /* Modern Browsers */ + url('/fonts/oxygen-v8-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */ + url('/fonts/oxygen-v8-latin-700.svg#Oxygen') format('svg'); /* Legacy iOS */ } /* oxygen-mono-regular - latin */ @font-face { font-family: 'Oxygen Mono'; font-style: normal; font-weight: 400; - src: url('oxygen-mono-v6-latin-regular.eot'); /* IE9 Compat Modes */ + src: url('/fonts/oxygen-mono-v6-latin-regular.eot'); /* IE9 Compat Modes */ src: local('Oxygen Mono'), local('OxygenMono-Regular'), - url('oxygen-mono-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('oxygen-mono-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ - url('oxygen-mono-v6-latin-regular.woff') format('woff'), /* Modern Browsers */ - url('oxygen-mono-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ - url('oxygen-mono-v6-latin-regular.svg#OxygenMono') format('svg'); /* Legacy iOS */ + url('/fonts/oxygen-mono-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('/fonts/oxygen-mono-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('/fonts/oxygen-mono-v6-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('/fonts/oxygen-mono-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('/fonts/oxygen-mono-v6-latin-regular.svg#OxygenMono') format('svg'); /* Legacy iOS */ } diff --git a/assets/book.scss b/assets/book.scss index 64cf13d..d0d8c19 100644 --- a/assets/book.scss +++ b/assets/book.scss @@ -2,6 +2,7 @@ @import "variables"; @import "markdown"; @import "utils"; +@import "fonts"; html { font-size: $font-size-base; diff --git a/layouts/partials/docs/html-head.html b/layouts/partials/docs/html-head.html index 35d0e81..5fbc549 100644 --- a/layouts/partials/docs/html-head.html +++ b/layouts/partials/docs/html-head.html @@ -2,12 +2,6 @@ {{- template "title" . }} | {{ .Site.Title -}} - -{{ if default true .Site.Params.googleFonts }} - {{ $fonts := resources.Get "_fonts.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }} - -{{ end }} - {{ $styles := resources.Get "book.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }} diff --git a/static/oxygen-mono-v6-latin-regular.eot b/static/fonts/oxygen-mono-v6-latin-regular.eot similarity index 100% rename from static/oxygen-mono-v6-latin-regular.eot rename to static/fonts/oxygen-mono-v6-latin-regular.eot diff --git a/static/oxygen-mono-v6-latin-regular.svg b/static/fonts/oxygen-mono-v6-latin-regular.svg similarity index 100% rename from static/oxygen-mono-v6-latin-regular.svg rename to static/fonts/oxygen-mono-v6-latin-regular.svg diff --git a/static/oxygen-mono-v6-latin-regular.ttf b/static/fonts/oxygen-mono-v6-latin-regular.ttf similarity index 100% rename from static/oxygen-mono-v6-latin-regular.ttf rename to static/fonts/oxygen-mono-v6-latin-regular.ttf diff --git a/static/oxygen-mono-v6-latin-regular.woff b/static/fonts/oxygen-mono-v6-latin-regular.woff similarity index 100% rename from static/oxygen-mono-v6-latin-regular.woff rename to static/fonts/oxygen-mono-v6-latin-regular.woff diff --git a/static/oxygen-mono-v6-latin-regular.woff2 b/static/fonts/oxygen-mono-v6-latin-regular.woff2 similarity index 100% rename from static/oxygen-mono-v6-latin-regular.woff2 rename to static/fonts/oxygen-mono-v6-latin-regular.woff2 diff --git a/static/oxygen-v8-latin-300.eot b/static/fonts/oxygen-v8-latin-300.eot similarity index 100% rename from static/oxygen-v8-latin-300.eot rename to static/fonts/oxygen-v8-latin-300.eot diff --git a/static/oxygen-v8-latin-300.svg b/static/fonts/oxygen-v8-latin-300.svg similarity index 100% rename from static/oxygen-v8-latin-300.svg rename to static/fonts/oxygen-v8-latin-300.svg diff --git a/static/oxygen-v8-latin-300.ttf b/static/fonts/oxygen-v8-latin-300.ttf similarity index 100% rename from static/oxygen-v8-latin-300.ttf rename to static/fonts/oxygen-v8-latin-300.ttf diff --git a/static/oxygen-v8-latin-300.woff b/static/fonts/oxygen-v8-latin-300.woff similarity index 100% rename from static/oxygen-v8-latin-300.woff rename to static/fonts/oxygen-v8-latin-300.woff diff --git a/static/oxygen-v8-latin-300.woff2 b/static/fonts/oxygen-v8-latin-300.woff2 similarity index 100% rename from static/oxygen-v8-latin-300.woff2 rename to static/fonts/oxygen-v8-latin-300.woff2 diff --git a/static/oxygen-v8-latin-700.eot b/static/fonts/oxygen-v8-latin-700.eot similarity index 100% rename from static/oxygen-v8-latin-700.eot rename to static/fonts/oxygen-v8-latin-700.eot diff --git a/static/oxygen-v8-latin-700.svg b/static/fonts/oxygen-v8-latin-700.svg similarity index 100% rename from static/oxygen-v8-latin-700.svg rename to static/fonts/oxygen-v8-latin-700.svg diff --git a/static/oxygen-v8-latin-700.ttf b/static/fonts/oxygen-v8-latin-700.ttf similarity index 100% rename from static/oxygen-v8-latin-700.ttf rename to static/fonts/oxygen-v8-latin-700.ttf diff --git a/static/oxygen-v8-latin-700.woff b/static/fonts/oxygen-v8-latin-700.woff similarity index 100% rename from static/oxygen-v8-latin-700.woff rename to static/fonts/oxygen-v8-latin-700.woff diff --git a/static/oxygen-v8-latin-700.woff2 b/static/fonts/oxygen-v8-latin-700.woff2 similarity index 100% rename from static/oxygen-v8-latin-700.woff2 rename to static/fonts/oxygen-v8-latin-700.woff2 diff --git a/static/oxygen-v8-latin-regular.eot b/static/fonts/oxygen-v8-latin-regular.eot similarity index 100% rename from static/oxygen-v8-latin-regular.eot rename to static/fonts/oxygen-v8-latin-regular.eot diff --git a/static/oxygen-v8-latin-regular.svg b/static/fonts/oxygen-v8-latin-regular.svg similarity index 100% rename from static/oxygen-v8-latin-regular.svg rename to static/fonts/oxygen-v8-latin-regular.svg diff --git a/static/oxygen-v8-latin-regular.ttf b/static/fonts/oxygen-v8-latin-regular.ttf similarity index 100% rename from static/oxygen-v8-latin-regular.ttf rename to static/fonts/oxygen-v8-latin-regular.ttf diff --git a/static/oxygen-v8-latin-regular.woff b/static/fonts/oxygen-v8-latin-regular.woff similarity index 100% rename from static/oxygen-v8-latin-regular.woff rename to static/fonts/oxygen-v8-latin-regular.woff diff --git a/static/oxygen-v8-latin-regular.woff2 b/static/fonts/oxygen-v8-latin-regular.woff2 similarity index 100% rename from static/oxygen-v8-latin-regular.woff2 rename to static/fonts/oxygen-v8-latin-regular.woff2