Last active
March 11, 2019 06:57
-
-
Save 867/0d52a6680459c3b79c88e7a03e6e0c66 to your computer and use it in GitHub Desktop.
公式ブログ用:Nunjucks-news1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set news_category1 = '' %} | |
{% set news_category2 = '' %} | |
{% set news_amount = 5 %} | |
{% block contents -%} | |
<section> | |
<header> | |
<h2>ニュース</h2> | |
</header> | |
<ul> | |
{% if news_category1 == '' and news_category2 == '' -%} | |
{% for item in news -%} | |
{% if loop.index <= news_amount -%} | |
<li> | |
<dl> | |
<dt>{{ item.date }}</dt> | |
{% if item.category1 == 'ir' -%} | |
<dd>IR</dd> | |
{% elif item.category1 == 'company' -%} | |
<dd>企業情報</dd> | |
{% elif item.category1 == 'pro' -%} | |
<dd>製品情報</dd> | |
{% endif -%} | |
<dd><a href="{{ item.url }}">{{ item.title }}</a></dd> | |
</dl> | |
</li> | |
{% endif -%} | |
{% endfor -%} | |
{% endif -%} | |
</ul> | |
</section> | |
{%- endblock -%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment