Skip to content

Commit da78bd5

Browse files
authored
Merge pull request #1175 from swiftlang/fb/authors-changes
Change authors to handle one or more authors
2 parents d8d7c0d + a65af0e commit da78bd5

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

_includes/authors.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="authors{% if include.compact %} compact{% endif %}">
1+
<div class="authors{% if include.compact %} compact{% endif %}{% if include.fullwidth %} fullwidth{% endif %}">
22
{% for page_author in include.authors %}
33
{% assign author = site.data.authors[page_author] %}
44
{% if author.name %}

_layouts/new-layouts/post.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
<div class="content">
99
<h1>{{ page.title }}</h1>
1010

11-
{% include authors.html authors=page.author compact=true %}
11+
{% assign compact_flag = false %}
12+
{% if page.author.size > 1 %}
13+
{% assign compact_flag = true %}
14+
{% endif %}
15+
{% include authors.html authors=page.author compact=compact_flag fullwidth=true %}
1216

1317
<time pubdate datetime="{{ page.date | date_to_xmlschema }}"
1418
>{{ page.date | date: "%B %-d, %Y" }}</time
@@ -30,16 +34,15 @@ <h1>{{ page.title }}</h1>
3034
{% endif %}
3135
<div class="details">
3236
{{ content }} {% if page.author %}
33-
<hr />
37+
3438
{% assign authors = page.author | array %}
3539

3640
{% if authors.size > 1 %}
41+
<hr />
3742
<h2>Authors</h2>
38-
{% else %}
39-
<h2>Author</h2>
43+
{% include authors.html authors=authors %}
4044
{% endif %}
4145

42-
{% include authors.html authors=authors %}
4346
{% endif %}
4447

4548
<hr />

assets/stylesheets/new-stylesheets/includes/authors/_base.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
}
1414
}
1515

16+
&.fullwidth {
17+
grid-template-columns: repeat(1, 1fr);
18+
color: var(--color-syntax-plain-text);
19+
}
20+
1621
&.compact {
1722
display: flex;
1823
flex-wrap: wrap;

0 commit comments

Comments
 (0)