Skip to content

Commit

Permalink
Default to "GitHub" as author in guide-card (github#16717)
Browse files Browse the repository at this point in the history
* Default authors to ['GitHub']

* Remove now-redundant GitHub authors
  • Loading branch information
JasonEtco authored Dec 2, 2020
1 parent 685e7a3 commit b081355
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 31 deletions.
2 changes: 0 additions & 2 deletions content/actions/guides/publishing-nodejs-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ redirect_from:
versions:
free-pro-team: '*'
enterprise-server: '>=2.22'
authors:
- GitHub
---

{% data reusables.actions.enterprise-beta %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ redirect_from:
versions:
free-pro-team: '*'
enterprise-server: '>=2.22'
authors:
- GitHub
---

{% data reusables.actions.enterprise-beta %}
Expand Down
57 changes: 30 additions & 27 deletions includes/guide-card.html
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
{% assign authorsString = guide.page.authors | join: ", @" %}
{% if guide.page.authors %}
{% assign authors = guide.page.authors %}
{% else %}
{% assign authors = 'GitHub' | split: ' ' %}
{% endif %}
{% assign authorsString = authors | join: ", @" %}

<div class="col-lg-4 col-12 mb-3">
<a class="Box box-shadow-medium height-full d-block hover-shadow-large no-underline text-gray-dark p-5" href="{{ guide.href }}">
<h2>{{ guide.title }}</h2>
<p class="mt-2 mb-4 text-gray-light">{{ guide.intro }}</p>

{% if guide.page.authors and guide.page.authors.length > 0 %}
<footer class="d-flex">
<div class="mr-1">
{% if guide.page.authors.length == 1 %}
<img class="avatar avatar-2 circle mr-1" src="https://github.com/{{ guide.page.authors[0] }}.png" alt="@{{ guide.page.authors[0] }}" />
{% else %}
<div class="AvatarStack AvatarStack--three-plus">
<div
class="AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1"
aria-label="@{{ authorsString }}"
>
{% for author in guide.page.authors %}
<img
class="avatar circle"
alt="@{{ author }}"
src="https://github.com/{{ author }}.png"
/>
{% endfor %}
</div>
<footer class="d-flex">
<div class="mr-1">
{% if authors.length == 1 %}
<img class="avatar avatar-2 circle mr-1" src="https://github.com/{{ authors[0] }}.png" alt="@{{ authors[0] }}" />
{% else %}
<div class="AvatarStack AvatarStack--three-plus">
<div
class="AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1"
aria-label="@{{ authorsString }}"
>
{% for author in authors %}
<img
class="avatar circle"
alt="@{{ author }}"
src="https://github.com/{{ author }}.png"
/>
{% endfor %}
</div>
{% endif %}
</div>
</div>
{% endif %}
</div>

<div>
@{{ authorsString }}
</div>
</footer>
{% endif %}
<div>
@{{ authorsString }}
</div>
</footer>
</a>
</div>

0 comments on commit b081355

Please sign in to comment.