From 43654c1a702aa2def73483d744cd69a29cbaf882 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Fri, 10 Mar 2017 12:35:33 -0500 Subject: [PATCH] Add configurable Google Fonts from `_data/theme.yml` file --- README.md | 13 ++++++++++++- _data/theme.yml | 15 ++++++++++++++- _includes/head.html | 4 +++- example/_data/theme.yml | 15 ++++++++++++++- 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 43c599b..9afdd8f 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,17 @@ This theme comes in six different skins (color variations). To change skins add | `skin: default` | `skin: night` | `skin: plum` | | `skin: sea` | `skin: soft` | `skin: steel` | +### Google Fonts + +This theme allows you to easily use [Google Fonts](https://fonts.google.com/) throughout the theme. Simply add the following to your [`/_data/theme.yml`](_data/theme.yml), replacing the font `name` and `weights` accordingly. + +```yaml +google_fonts: + - name: "Fira Sans" + weights: "400,400i,600,600i" + - name: "Fira Sans Condensed" +``` + ### Text To change text found throughout the theme add the following to your [`/_data/theme.yml`](_data/theme.yml) file and customize as necessary. @@ -66,7 +77,7 @@ t: By default all internal pages with a `title` will be added to the "off-canvas" menu. For more granular control and sorting of these menu links: -1. Create a custom list to override the default setting by adding a `navigation_pages` array to your `_config.yml` file. +1. Create a custom list to override the default setting by adding a `navigation_pages` array to your [`/_data/themes.yml`](_data/themes.yml) file. 2. Add raw page paths in the order you'd like: diff --git a/_data/theme.yml b/_data/theme.yml index c1712f7..779af36 100644 --- a/_data/theme.yml +++ b/_data/theme.yml @@ -15,4 +15,17 @@ t: read_more: "Read More" posts: "Posts" page: "Page" - of: "of" \ No newline at end of file + of: "of" + +# Google Fonts +google_fonts: + - name: "Fira Sans" + weights: "400,400i,600,600i" + +# Link to specific internal pages in the navigation. +# Create a custom list to override the default setting of including links to all +# pages that have a `title`. Add raw page paths in the order you'd like. + +navigation_pages: + - about.md + - cv.md \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index dd2cd2a..424d1f6 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -22,7 +22,9 @@ - + {% if site.data.theme.google_fonts %} + + {% endif %} {% if site.gems contains 'jekyll-feed' %} {% comment %} diff --git a/example/_data/theme.yml b/example/_data/theme.yml index c1712f7..779af36 100644 --- a/example/_data/theme.yml +++ b/example/_data/theme.yml @@ -15,4 +15,17 @@ t: read_more: "Read More" posts: "Posts" page: "Page" - of: "of" \ No newline at end of file + of: "of" + +# Google Fonts +google_fonts: + - name: "Fira Sans" + weights: "400,400i,600,600i" + +# Link to specific internal pages in the navigation. +# Create a custom list to override the default setting of including links to all +# pages that have a `title`. Add raw page paths in the order you'd like. + +navigation_pages: + - about.md + - cv.md \ No newline at end of file