Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show date of posts #2526

Merged
merged 12 commits into from
Aug 4, 2020
6 changes: 1 addition & 5 deletions _includes/archive-single.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ <h2 class="archive__item-title" itemprop="headline">
<a href="{{ post.url | relative_url }}" rel="permalink">{{ title }}</a>
{% endif %}
</h2>
{% if include.type == "grid" %}
{% include post__meta.html p="post" type="grid" %}
{% else %}
{% include post__meta.html p="post" %}
{% endif %}
{% include post__meta.html type = include.type %}
limjh16 marked this conversation as resolved.
Show resolved Hide resolved
{% if post.excerpt %}<p class="archive__item-excerpt" itemprop="description">{{ post.excerpt | markdownify | strip_html | truncate: 160 }}</p>{% endif %}
</article>
</div>
2 changes: 1 addition & 1 deletion _includes/page__hero.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1 id="page-title" class="page__title" itemprop="headline">
{% elsif page.header.show_overlay_excerpt != false and page.excerpt %}
<p class="page__lead">{{ page.excerpt | markdownify | remove: "<p>" | remove: "</p>" }}</p>
{% endif %}
{% include post__meta.html p="page" %}
{% include post__meta.html %}
{% if page.header.cta_url %}
<p><a href="{{ page.header.cta_url | relative_url }}" class="btn btn--light-outline btn--large">{{ page.header.cta_label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}</a></p>
{% endif %}
Expand Down
16 changes: 8 additions & 8 deletions _includes/post__meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
{% if page.read_time or page.show_date %}
<p class="page__meta">

{% if page.show_date %}
{% assign date = page.date %}
<i class="far {% if include.type == 'grid' and page.read_time and page.show_date %}fa-fw {% endif %}fa-calendar-alt" aria-hidden="true"></i>
<time datetime="{{ date | date_to_xmlschema }}">{{ date | date: "%B %-d, %Y" }}</time>
{% endif %}

{% if page.read_time and page.show_date %}{% if include.type == "grid" %}<br \>{% else %}|{% endif %}{% endif %}

{% if page.read_time %}
{% assign words_per_minute = page.words_per_minute | default: site.words_per_minute | default: 200 %}
{% assign words = page.content | strip_html | number_of_words %}
Expand All @@ -17,13 +25,5 @@
{% endif %}
{% endif %}

{% if page.read_time and page.show_date %}{% if include.type == "grid" %}<br \>{% else %}|{% endif %}{% endif %}

{% if page.show_date %}
{% assign date = page.date %}
<i class="far {% if include.type == 'grid' and page.read_time and page.show_date %}fa-fw {% endif %}fa-calendar-alt" aria-hidden="true"></i>
<time datetime="{{ date | date_to_xmlschema }}">{{ date | date: "%B %-d, %Y" }}</time>
{% endif %}

</p>
{% endif %}
2 changes: 1 addition & 1 deletion _layouts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{% unless page.header.overlay_color or page.header.overlay_image %}
<header>
{% if page.title %}<h1 id="page-title" class="page__title" itemprop="headline">{{ page.title | markdownify | remove: "<p>" | remove: "</p>" }}</h1>{% endif %}
{% include post__meta.html p="page" %}
{% include post__meta.html %}
</header>
{% endunless %}

Expand Down