Skip to content

Commit cabac87

Browse files
committed
Add related guides to page footer.
Allow specifying `related` in article metadata and using that to add related guides to the bottom of an article. Added an example to Best Practices which are bad and wrong and should be updated.
1 parent 0441d7f commit cabac87

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

_articles/best-practices.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ toc:
1111
its-okay-to-hit-pause: "It’s okay to hit pause"
1212
order: 5
1313
image: /assets/images/cards/best-practices.png
14+
related:
15+
- building
16+
- coc
1417
---
1518

1619
## What does it mean to be a maintainer?

_layouts/article.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,33 @@ <h1 class="alt-h1 lh-condensed text-center mb-3">{{ page.title }}</h1>
5656
</div>
5757
</article>
5858

59+
{% if page.related %}
60+
<div class="container-lg p-responsive mx-auto border-top text-center pt-5">
61+
<h2 class="alt-h2">Related Guides</h2>
62+
<div class="gutter-sm d-flex flex-wrap flex-items-stretch pb-md-6">
63+
{% for related in page.related %}
64+
{% assign article = site.articles | where: "class", related | first %}
65+
<div class="col-12 col-sm-9 mx-auto col-md-6 mt-4 mt-lg-5">
66+
<a href="{{ article.url | relative_url }}" class="guide-cover {{ article.class }} card height-full d-block">
67+
68+
<div class="lh-none guide-cover-img text-center pt-4">
69+
<img src="{{ site.baseurl }}/assets/images/illos/{{ article.class }}.svg" class="" alt="{{ article.title }} illustration">
70+
</div>
71+
72+
<div class="flex-self-end p-4 text-center p-lg-5">
73+
<h3 class="alt-h3 text-bold lh-condensed mb-2 text-black">
74+
{{ article.title }}
75+
</h3>
76+
<div class="mb-0 text-gray">
77+
{{ article.description | markdownify }}
78+
</div>
79+
</div>
80+
81+
</a>
82+
</div>
83+
{% endfor %}
84+
</div>
85+
</div>
86+
{% endif %}
87+
5988
{% include footer.html %}

0 commit comments

Comments
 (0)