diff --git a/_data/authors.yml b/_data/authors.yml new file mode 100644 index 0000000000..3e89526d9c --- /dev/null +++ b/_data/authors.yml @@ -0,0 +1,5 @@ +- id: uabrisketa + name: Unai A. + full_name: Unai Abrisketa + description: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + image: male_avatar.jpg diff --git a/_includes/components/authors.html b/_includes/components/authors.html new file mode 100644 index 0000000000..ebd2a0a2b1 --- /dev/null +++ b/_includes/components/authors.html @@ -0,0 +1,28 @@ +{% for author in page.about_authors %} + {% assign author_data = site.data.authors | where:"id", author | first %} + {% unless author_data %} + {% assign no_author = true %} + {% endunless %} +{% endfor %} + +{% if no_author %} +
+{% else %} +
+

About the author{% if page.about_authors.size > 1 %}s{% endif %}

+ +
+ {% for author in page.about_authors %} + {% assign author_data = site.data.authors | where:"id", author | first %} +
+ + + +
+ {{ author_data.full_name }} {{ author_data.description }} +
+
+ {% endfor %} +
+
+{% endif %} diff --git a/_includes/components/tags.html b/_includes/components/tags.html index f46c277e10..2f72e43e8f 100644 --- a/_includes/components/tags.html +++ b/_includes/components/tags.html @@ -4,7 +4,6 @@ {% assign tags = page.tags | strip %} {% if tags != '[]' %}
-
{% for tag in page.tags %}
diff --git a/_layouts/post.html b/_layouts/post.html index 25d9dfd8f2..be518c9a8c 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -10,8 +10,9 @@
{{ content }} - {% include components/post-share.html %} + {% include components/authors.html %} {% include components/tags.html %} + {% include components/post-share.html %}
{% include components/cross-reading.html %}
diff --git a/_sass/2-components/_all-components.sass b/_sass/2-components/_all-components.sass index ce6eae9241..2e967d5737 100644 --- a/_sass/2-components/_all-components.sass +++ b/_sass/2-components/_all-components.sass @@ -16,3 +16,5 @@ @import 'scroll-top' @import 'search-bar' @import 'slider' +@import 'authors' +@import 'separators' diff --git a/_sass/2-components/_authors.sass b/_sass/2-components/_authors.sass new file mode 100644 index 0000000000..c99387bfec --- /dev/null +++ b/_sass/2-components/_authors.sass @@ -0,0 +1,64 @@ +.author + + &s + margin-top: $card-margin-mobile + + +grid-media($grid-medium) + margin-top: $card-margin-desktop + + &__container + +grid-collapse + +grid-container + + &__card + +grid-column(12) + background: #eee + padding: $card-margin-mobile + box-sizing: border-box + display: flex + flex-direction: column + align-items: center + margin-bottom: $card-margin-mobile + + +grid-media($grid-medium) + padding: calc(#{$card-margin-desktop} / 2) $card-margin-desktop + + &--1, &--2 + flex-direction: row + align-items: center + + &--2 + + +grid-media($grid-medium) + +grid-column(6) + margin-bottom: 0 + + &--3 + + +grid-media($grid-large) + +grid-column(4) + margin-bottom: 0 + + &__image + border-radius: 100% + overflow: hidden + margin-bottom: 2rem + + &--1 + +size(10rem) + min-height: 10rem + min-width: 10rem + + &--1, &--2 + margin-bottom: 0 + + &--2, &--3 + +size(5.6rem) + min-height: 5.6rem + min-width: 5.6rem + + img + +size(100%) + + &__description + margin: 0 2rem diff --git a/_sass/2-components/_cards.sass b/_sass/2-components/_cards.sass index d2dd1e5ac2..7f3186c9ab 100644 --- a/_sass/2-components/_cards.sass +++ b/_sass/2-components/_cards.sass @@ -44,7 +44,7 @@ $widths: 5,10,15,20,25,30,35,40,45,50,100 li margin-left: 1em - div:not(.custom-image) img:not(.icon-share), P img:not(.icon-share) + div:not(.custom-image .author__image) img:not(.icon-share), P img:not(.icon-share) margin: 2rem 0 margin-left: -$card-margin-mobile width: calc(100% + #{$card-margin-mobile} * 2) diff --git a/_sass/2-components/_separators.sass b/_sass/2-components/_separators.sass new file mode 100644 index 0000000000..dd62e70bd7 --- /dev/null +++ b/_sass/2-components/_separators.sass @@ -0,0 +1,5 @@ +.separator + margin-bottom: 4rem 0 + border: $base-border + border-color: darken($whitesmoke, 2%) + width: 75% diff --git a/_sass/2-components/_tags.sass b/_sass/2-components/_tags.sass index 5c6cd27dca..e664ffd4b1 100644 --- a/_sass/2-components/_tags.sass +++ b/_sass/2-components/_tags.sass @@ -4,13 +4,6 @@ +grid-media($grid-medium) margin: 4rem $card-margin-desktop 2rem - hr - margin-top: 0 - margin-bottom: 4rem - border: $base-border - border-color: darken($whitesmoke, 2%) - width: 75% - .tags-wrapper display: flex justify-content: center diff --git a/assets/img/pages/blog/authors/female_avatar.jpg b/assets/img/pages/blog/authors/female_avatar.jpg new file mode 100644 index 0000000000..b08eb20e52 Binary files /dev/null and b/assets/img/pages/blog/authors/female_avatar.jpg differ diff --git a/assets/img/pages/blog/authors/male_avatar.jpg b/assets/img/pages/blog/authors/male_avatar.jpg new file mode 100644 index 0000000000..85f248f9a7 Binary files /dev/null and b/assets/img/pages/blog/authors/male_avatar.jpg differ