From 20c75f05ae95ee23b6186c1239019c1d7225c9f8 Mon Sep 17 00:00:00 2001 From: Barry Pollard Date: Mon, 10 Aug 2020 01:37:25 +0100 Subject: [PATCH] Better author social media on website (#1185) * Better Author Data * Clean up * Move icons up if space * Linting fixes * Hide social media from screen-readers * Move social media to new line all the time * Revert author link change * Review feedback --- src/static/css/page.css | 19 +++++++++++++++---- src/templates/base/2019/base_chapter.html | 21 +++++++++++++-------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/static/css/page.css b/src/static/css/page.css index 81a16936afd..e2cc3d40326 100644 --- a/src/static/css/page.css +++ b/src/static/css/page.css @@ -257,8 +257,8 @@ .authors .name { font-size: 24px; font-size: 1.5rem; - margin-right: 10px; - margin-right: 0.625rem; + margin-right: 16px; + margin-right: 1rem; margin-bottom: 10px; margin-bottom: 0.625rem; display: inline-block; @@ -280,19 +280,30 @@ } .authors .social a { - margin: 0 10px 0 0; - margin: 0 0.625rem 0 0; + margin-right: 10px; + margin-right: 0.625rem; white-space: nowrap; display: inline-flex; align-items: center; text-decoration: none; } +.authors .social a:last-child { + margin-right: 0; +} + .authors .social a:hover, .authors .social a:focus { text-decoration: underline; } +.authors .social svg { + width: 1em; + height: auto; + margin-right: 4px; + margin-right: 0.25rem; +} + #chapter-navigation { padding: 50px 36px; padding: 3.125rem 2.25rem; diff --git a/src/templates/base/2019/base_chapter.html b/src/templates/base/2019/base_chapter.html index ba808b800b2..dbb0951a5b5 100644 --- a/src/templates/base/2019/base_chapter.html +++ b/src/templates/base/2019/base_chapter.html @@ -19,6 +19,7 @@ "https://almanac.httparchive.org{{ url_for('contributors', year=year, lang=lang, _anchor=author) }}" {% if authordata.twitter %},"https://twitter.com/{{ authordata.twitter }}"{% endif %} {% if authordata.github %},"https://github.com/{{ authordata.github }}"{% endif %} + {% if authordata.linkedin %},"https://www.linkedin.com/in/{{ authordata.linkedin }}/"{% endif %} ], "name": "{{ authordata.name if authordata.name else author }}" }{% if loop.index < loop.length %},{% endif %} @@ -86,7 +87,7 @@ {% macro render_byline() %}
{{ self.written_by_before() }} {% for author in metadata.get('authors') %} - {{ config.contributors[author].name if author in config.contributors else author }}{{ self.comma() if not loop.last }} + {{ config.contributors[author].name if author in config.contributors else author }}{{ self.comma() if not loop.last }} {% if loop.index == loop.length - 1 %}{{ self.and() }}{% endif %} {% endfor %}{{ self.written_by_after() }}
@@ -129,41 +130,45 @@

{{ authordata.name if authordata.name else author }} - {% if authordata.twitter or authordata.github %} -