From abd037068d5e9b6ad9e5027d705ae9efe3454183 Mon Sep 17 00:00:00 2001 From: Manas Date: Sat, 11 Feb 2017 00:09:14 +0530 Subject: [PATCH] Add an option to connect main pic to social profile image from facebook, github or gravatar. In reference to issue #206, implement an option to connect main pic to facebook, github or gravatar profile image. --- .github/CONTRIBUTORS.md | 1 + _config.yml | 20 +++++++++++++++++ _includes/header.html | 6 +++++- _posts/2015-06-24-intro-layout-tutorial.md | 25 ++++++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) diff --git a/.github/CONTRIBUTORS.md b/.github/CONTRIBUTORS.md index c9facca..9b46f06 100644 --- a/.github/CONTRIBUTORS.md +++ b/.github/CONTRIBUTORS.md @@ -7,6 +7,7 @@ In alphabetical order: 5. Jose Zamudio 6. Jørn Ølmheim 7. Kartik Arora + 8. Manas Gupta 8. Marcus Eisele 9. Mike Kasberg 10. Nathan Jaremkio diff --git a/_config.yml b/_config.yml index 0e9ca91..8f92e70 100755 --- a/_config.yml +++ b/_config.yml @@ -60,6 +60,26 @@ lines: # You can add HTML Tags in the Text me-img: "/img/jetpacktocat.png" +# To use facebook profile pic comment the previous line and uncomment the following +# line, and replace 'user_id' with your facebook user id. +# Facebook user id can be found by clicking on your profile pic and the large number +# in the end of the url just before '&type' is your user id. +# Note: fbid is not the same as user id and user id only contains numbers + +# me-img: "https://graph.facebook.com/user_id/picture?type=large&width=500&height=500" + +# To use github profile pic uncomment the following line and replace 'user_name' +# with your github user name. + +# me-img: "https://github.com/user_name.png?size=500" + +# To use gravatar profile pic uncomment the following line and replace 'email_hash' +# with your gravatar profile email hash. +# You can create the email hash by using an online tool like 'http://www.md5hashgenerator.com/' +# just enter your email and it will generate the hash. + +# me-img: "https://www.gravatar.com/avatar/email_hash?s=500" + ############################## # Color the browser elements # ############################## diff --git a/_includes/header.html b/_includes/header.html index f1d329d..aa07da6 100755 --- a/_includes/header.html +++ b/_includes/header.html @@ -11,7 +11,11 @@ {{ content }}
 
- + {% if site.me-img contains "https://" %} + + {% else %} + + {% endif %} diff --git a/_posts/2015-06-24-intro-layout-tutorial.md b/_posts/2015-06-24-intro-layout-tutorial.md index 0290b91..3a17fa9 100644 --- a/_posts/2015-06-24-intro-layout-tutorial.md +++ b/_posts/2015-06-24-intro-layout-tutorial.md @@ -61,4 +61,29 @@ You can set your image from the following variable: me-img: "/img/jetpacktocat.png" +If you want to connect your Facebook profile image then you can use the following. +Replace `user_id` with your facebook user id. Facebook user id can be found by clicking +on your profile pic and the large number in the end of the url just before '&type' is your user id. +Note: fbid is not the same as user id and user id only contains numbers. + +

+me-img: "https://graph.facebook.com/user_id/picture?type=large&width=500&height=500"
+
+ +If you want to connect your Github profile image then you can use the following. +Replace `user_name` with your Github user name. + +

+me-img: "https://github.com/user_name.png?size=500"
+
+ +If you want to connect your Gravatar profile image then you can use the following. +Replace `email_hash` with your Gravatar profile email hash. +You can create the email hash by using an online tool like [md5hashgenerator](http://www.md5hashgenerator.com/), +just enter your email and it will generate the hash. + +

+me-img: "https://www.gravatar.com/avatar/email_hash?s=500"
+
+ All set!