Skip to content

Commit 077b220

Browse files
feat: update contributors fields and display (fix #103) (#125)
* feat: update contributors fields and display (fix #103) * fix: remove test data
1 parent 671ef7a commit 077b220

3 files changed

Lines changed: 32 additions & 38 deletions

File tree

src/_includes/layouts/home.njk

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,21 @@
4747
<div class="[ wrapper ]">
4848
<div class="[ contributors ]">
4949
{% for contributor in contributors.contributors %}
50-
<a href="{{ contributor.link }}" rel="external">
51-
{% if contributor.image %}
52-
<img src="{{ contributor.image }}" width="150" height="150" alt="" />
53-
{% else %}
54-
<img src="https://source.boringavatars.com/ring/150/{{ contributor.name | replace(' ', '%20') }}?colors=516d95,d2a27a,882211,337777,f75322" width="150" height="150" alt="" />
55-
{% endif %}
56-
<span>{{ contributor.name }}</span>
57-
</a>
50+
<div class="[ contributor ]">
51+
{% if contributor.link %}
52+
<a href="{{ contributor.link }}" rel="external">
53+
{{ contributor.name }}
54+
{%- if contributor.organization %}<br />
55+
<strong>{{ contributor.organization }}</strong>
56+
{% endif %}
57+
</a>
58+
{% else %}
59+
{{ contributor.name }}
60+
{%- if contributor.organization %}<br />
61+
<strong>{{ contributor.organization }}</strong>
62+
{% endif %}
63+
{% endif %}
64+
</div>
5865
{% endfor %}
5966
</div>
6067
</div>

src/admin/config.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ collections:
3838
- label: Content
3939
name: content
4040
widget: markdown
41-
buttons:
42-
[heading-three, heading-four, bold, italic, link, bulleted-list, numbered-list]
41+
buttons: [heading-three, heading-four, bold, italic, link, bulleted-list, numbered-list]
4342
editor_components: [image]
4443

4544
- label: Ground Rules
@@ -50,8 +49,7 @@ collections:
5049
- label: Content
5150
name: content
5251
widget: markdown
53-
buttons:
54-
[heading-three, heading-four, bold, italic, link, bulleted-list, numbered-list]
52+
buttons: [heading-three, heading-four, bold, italic, link, bulleted-list, numbered-list]
5553
editor_components: [image]
5654

5755
- label: How To
@@ -62,8 +60,7 @@ collections:
6260
- label: Content
6361
name: content
6462
widget: markdown
65-
buttons:
66-
[heading-three, heading-four, bold, italic, link, bulleted-list, numbered-list]
63+
buttons: [heading-three, heading-four, bold, italic, link, bulleted-list, numbered-list]
6764
editor_components: [image]
6865

6966
- label: Contributors
@@ -74,8 +71,7 @@ collections:
7471
- label: Content
7572
name: content
7673
widget: markdown
77-
buttons:
78-
[heading-three, heading-four, bold, italic, link, bulleted-list, numbered-list]
74+
buttons: [heading-three, heading-four, bold, italic, link, bulleted-list, numbered-list]
7975
editor_components: [image]
8076

8177
- label: Connect
@@ -87,8 +83,7 @@ collections:
8783
- label: Content
8884
name: content
8985
widget: markdown
90-
buttons:
91-
[heading-three, heading-four, bold, italic, link, bulleted-list, numbered-list]
86+
buttons: [heading-three, heading-four, bold, italic, link, bulleted-list, numbered-list]
9287
editor_components: [image]
9388

9489
- label: Planning
@@ -214,5 +209,5 @@ collections:
214209
summary: "{{fields.name}}"
215210
fields:
216211
- {label: Name, name: name, widget: string}
217-
- {label: Link, name: link, widget: string}
218-
- {label: Photo, name: photo, widget: image, required: false}
212+
- {label: Organization, name: organization, widget: string, required: false}
213+
- {label: Link, name: link, widget: string, required: false}

src/assets/styles/pages/_home.scss

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,23 @@
77
}
88

99
.home .contributors {
10+
column-gap: var(--space-xl);
1011
display: grid;
11-
grid-template-columns: repeat(2, 1fr);
12+
grid-template-columns: 1fr;
1213
margin-inline: auto;
13-
row-gap: calc(5 * var(--space-md));
14+
max-inline-size: 75ch;
15+
row-gap: var(--space-md);
1416

15-
a {
16-
display: block;
17-
font-weight: bold;
18-
text-align: center;
19-
20-
img {
21-
border-radius: 50%;
22-
display: block;
23-
margin-inline: auto;
24-
}
25-
26-
span {
27-
display: block;
28-
margin-block-start: var(--space-sm);
29-
}
17+
.contributor {
18+
display: flex;
19+
flex-direction: column;
20+
justify-content: flex-start;
21+
text-align: start;
3022
}
3123
}
3224

3325
@media (min-width: 960px) {
3426
.home .contributors {
35-
grid-template-columns: repeat(5, 1fr);
27+
grid-template-columns: repeat(2, 1fr);
3628
}
3729
}

0 commit comments

Comments
 (0)