From b491a0604d025b85396dcbc98ac7da71e33d0852 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Thu, 26 Jan 2017 13:30:43 +0100 Subject: [PATCH] Show Gravatars in high-definition if suported by the browser --- source/author.html.haml | 2 +- source/layouts/post.haml | 2 +- source/partials/page_articles.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/author.html.haml b/source/author.html.haml index 583294e..87c064f 100644 --- a/source/author.html.haml +++ b/source/author.html.haml @@ -16,7 +16,7 @@ cover_license: '[Cover Image](https://unsplash.com/photos/2ShvY8Lf6l0) by [Lukas %section.author-profile.inner - if gravatar? %figure.author-image - .img{style: "background-image: url(#{gravatar(author, size: 114)})"} + .img{style: "background-image: url(#{gravatar(author, size: 114)}); background-image: image-set(url(#{gravatar(author, size: 114)}) 1x, url(#{gravatar(author, size: 114*2)}) 2x, url(#{gravatar(author, size: 114*3)}) 3x); background-image: -webkit-image-set(url(#{gravatar(author, size: 114)}) 1x, url(#{gravatar(author, size: 114*2)}) 2x, url(#{gravatar(author, size: 114*3)}) 3x);"} %span.hidden #{blog_author(author).name}'s Picture %h1.author-title= blog_author(author).name .author-bio= partial("author/#{author.parameterize}") diff --git a/source/layouts/post.haml b/source/layouts/post.haml index badf4c0..f6e724a 100644 --- a/source/layouts/post.haml +++ b/source/layouts/post.haml @@ -27,7 +27,7 @@ %footer.post-footer - if gravatar? %figure.author-image - %a.img{href: author_path, style: "background-image: url(#{gravatar})"} + %a.img{href: author_path, style: "background-image: url(#{gravatar(nil, size: 68)}); background-image: image-set(url(#{gravatar(nil, size: 68)}) 1x, url(#{gravatar(nil, size: 68*2)}) 2x, url(#{gravatar(nil, size: 68*2)}) 3x); background-image: -webkit-image-set(url(#{gravatar(nil, size: 68)}) 1x, url(#{gravatar(nil, size: 68*2)}) 2x, url(#{gravatar(nil, size: 68*2)}) 3x)"} %span.hidden #{blog_author.name}'s Picture %section.author %h4 diff --git a/source/partials/page_articles.haml b/source/partials/page_articles.haml index 8f6346e..723fa29 100644 --- a/source/partials/page_articles.haml +++ b/source/partials/page_articles.haml @@ -12,7 +12,7 @@ = link_to '» Read more', article, class: 'read-more' %footer.post-meta - if gravatar? - %img.author-thumb{src: gravatar(article.data.author, size: 24), alt: blog_author(article.data.author).name, nopin: 'nopin'} + %img.author-thumb{src: gravatar(article.data.author, size: 24), srcset: "#{gravatar(article.data.author, size: 24)} 1x, #{gravatar(article.data.author, size: 24*2)} 2x, #{gravatar(article.data.author, size: 24*3)} 3x", alt: blog_author(article.data.author).name, nopin: 'nopin'} %a{href: author_path(article.data.author)}= blog_author(article.data.author).name - if tags?(article) on #{tags(article)}