1
0
mirror of https://github.com/github/choosealicense.com synced 2024-11-13 23:18:53 +01:00
choosealicense.com/_includes/using-sentence.html
Ian Lee ff122da796 Add 's' when only a single license
When `using.size` == 1, add an 's' to the using sentence.
2016-04-09 15:24:15 -07:00

18 lines
666 B
HTML

{% assign id = "/licenses/" | append: include.license-id %}
{% assign licenses = site.licenses | where:"id", id %}
{% for license in licenses %}
{% assign using = license.using %}
{% if using.size > 0 %}
{% for used in using limit: 3 %}
{% assign last = forloop.last %}
{% if last and using.size > 1 %}
and
{% endif %}
{% for hash in used %}
<a href="{{ hash[1] }}">{{ hash[0] }}</a>{% if last == false %},{% endif %}
{% endfor %}
{% endfor %}
use{% if using.size == 1 %}s{% endif %} the {% if license.nickname %}{{ license.nickname }}{% else %}{{ license.title }}{% endif %}.
{% endif %}
{% endfor %}