From 726508dd95a1f9b96d1945a7ccfa99d3596ed38a Mon Sep 17 00:00:00 2001 From: Hristo Yankov Date: Sun, 7 Feb 2016 18:22:13 +0200 Subject: [PATCH 1/4] Add conditional avatar --- README.md | 1 + _includes/nav.html | 10 +++++----- _layouts/default.html | 9 +++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e6e35ba..986c4f1 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,7 @@ css | List of local CSS files to include in the page ex-css | List of external CSS files to include in the page googlefonts | List of Google fonts to include in the page (eg. `["Monoton", "Lobster"]`) fb-img | If you want to share a page on Facebook, by default Facebook will use the first image it can find on the page. If you want to specify an image to use when sharing the page on Facebook, then provide the image's URL here +show_avatar | If you have an avatar configured in the _config.yml but you don't want to appear on every page you can turn it off by removing this flag from the default layout (_layouts/default.html) and enable it only on the pages where you want to. Note: the specific value doesn't matter only whether it's defined or not. ### RSS feed diff --git a/_includes/nav.html b/_includes/nav.html index e9aa662..0e9d434 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -22,7 +22,7 @@ {% assign internal = false %} {% endif %} {% endif %} - + {% if internal %} {% capture linkurl %}{{ site.baseurl }}/{{ link[1] }}{% endcapture %} {% else %} @@ -34,8 +34,8 @@ {% endfor %} - - {% if site.avatar %} + + {% if site.avatar and page.show-avatar %}
{% endif %} - + - + diff --git a/_layouts/default.html b/_layouts/default.html index 3956af3..5bc718d 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,4 +1,5 @@ --- +show-avatar: true common-css: - "/css/bootstrap.min.css" - "/css/main.css" @@ -15,11 +16,11 @@ common-js: - + {% include head.html %} - + {% include nav.html %}
@@ -27,8 +28,8 @@ common-js:
{% include footer.html %} - + {% include footer-scripts.html %} - + From bcf4d1dc19b1dd58a1df9acd1bf0b93cc75e4a17 Mon Sep 17 00:00:00 2001 From: Hristo Yankov Date: Mon, 8 Feb 2016 23:36:51 +0200 Subject: [PATCH 2/4] Add show-avatar: true to the default parameters --- README.md | 2 +- _config.yml | 1 + _layouts/default.html | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 986c4f1..19b1755 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ css | List of local CSS files to include in the page ex-css | List of external CSS files to include in the page googlefonts | List of Google fonts to include in the page (eg. `["Monoton", "Lobster"]`) fb-img | If you want to share a page on Facebook, by default Facebook will use the first image it can find on the page. If you want to specify an image to use when sharing the page on Facebook, then provide the image's URL here -show_avatar | If you have an avatar configured in the _config.yml but you don't want to appear on every page you can turn it off by removing this flag from the default layout (_layouts/default.html) and enable it only on the pages where you want to. Note: the specific value doesn't matter only whether it's defined or not. +show-avatar | If you have an avatar configured in the `_config.yml` but you want to turn it off on a specific page, use `show-avatar: false`. If you want to turn it off by default, change `show-avatar` to `false` in the file `_layouts/default.html` and then you can selectively turn it on in specific pages using `show-avatar: true` ### RSS feed diff --git a/_config.yml b/_config.yml index 3db29ab..c56c7a2 100644 --- a/_config.yml +++ b/_config.yml @@ -88,6 +88,7 @@ defaults: path: "" # all files values: layout: "default" + show-avatar: true # Exclude these files from production site exclude: diff --git a/_layouts/default.html b/_layouts/default.html index 5bc718d..447999a 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,5 +1,4 @@ --- -show-avatar: true common-css: - "/css/bootstrap.min.css" - "/css/main.css" From 2d5fb57c48fde3d085325cd9d64b5faf86f4a27b Mon Sep 17 00:00:00 2001 From: Hristo Yankov Date: Tue, 9 Feb 2016 00:40:05 +0200 Subject: [PATCH 3/4] Fix show-avatar to work on both pages and layouts --- _includes/nav.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/nav.html b/_includes/nav.html index 0e9d434..9d543d2 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -35,7 +35,7 @@ - {% if site.avatar and page.show-avatar %} + {% if site.avatar and (layout.show-avatar or page.show-avatar) %}
From 49d2fe3fdf04c266e6f47baf8ebbb9e01aab000c Mon Sep 17 00:00:00 2001 From: Hristo Yankov Date: Tue, 9 Feb 2016 01:06:48 +0200 Subject: [PATCH 4/4] Update the README.md with better show-avatar description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 19b1755..6509544 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ css | List of local CSS files to include in the page ex-css | List of external CSS files to include in the page googlefonts | List of Google fonts to include in the page (eg. `["Monoton", "Lobster"]`) fb-img | If you want to share a page on Facebook, by default Facebook will use the first image it can find on the page. If you want to specify an image to use when sharing the page on Facebook, then provide the image's URL here -show-avatar | If you have an avatar configured in the `_config.yml` but you want to turn it off on a specific page, use `show-avatar: false`. If you want to turn it off by default, change `show-avatar` to `false` in the file `_layouts/default.html` and then you can selectively turn it on in specific pages using `show-avatar: true` +show-avatar | If you have an avatar configured in the `_config.yml` but you want to turn it off on a specific page, use `show-avatar: false`. If you want to turn it off by default, locate the line `show-avatar: true` in the file `_config.yml` and change the `true` to `false`; then you can selectively turn it on in specific pages using `show-avatar: true`. ### RSS feed