1
0
mirror of https://github.com/meineerde/holgerjust.de.git synced 2025-10-17 17:01:01 +00:00

Show Gravatars in high-definition if suported by the browser

This commit is contained in:
Holger Just 2017-01-26 13:30:43 +01:00
parent d48036c700
commit b491a0604d
3 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ cover_license: '[Cover Image](https://unsplash.com/photos/2ShvY8Lf6l0) by [Lukas
%section.author-profile.inner %section.author-profile.inner
- if gravatar? - if gravatar?
%figure.author-image %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 %span.hidden #{blog_author(author).name}'s Picture
%h1.author-title= blog_author(author).name %h1.author-title= blog_author(author).name
.author-bio= partial("author/#{author.parameterize}") .author-bio= partial("author/#{author.parameterize}")

View File

@ -27,7 +27,7 @@
%footer.post-footer %footer.post-footer
- if gravatar? - if gravatar?
%figure.author-image %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 %span.hidden #{blog_author.name}'s Picture
%section.author %section.author
%h4 %h4

View File

@ -12,7 +12,7 @@
= link_to '» Read more', article, class: 'read-more' = link_to '» Read more', article, class: 'read-more'
%footer.post-meta %footer.post-meta
- if gravatar? - 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 %a{href: author_path(article.data.author)}= blog_author(article.data.author).name
- if tags?(article) - if tags?(article)
on #{tags(article)} on #{tags(article)}