---
layout: layouts/base.njk
eleventyNavigation:
  key: Now
  order: 4
numberOfLatestPostsToShow: 4
---
{% set postsCount = collections.now | length %}
{% set latestPostsCount = postsCount | min(numberOfLatestPostsToShow) %}
{% set postslist = collections.now | head(-1 * numberOfLatestPostsToShow) %}
{% set postslistCounter = postsCount %}
{% set morePosts = postsCount - numberOfLatestPostsToShow %}
<article>
<h1>Now: What’s Been Going on Lately?</h1>
{% set now = collections.now | last %}
<h2>{{ now.data.title }}</h2>
{{ now.content | safe }}
<p class="metadata">Updated: {{ now.date | readableDate }} |&nbsp;<a href="https://nownownow.com/about">What is a now page?</a></p>
</article>

{% if postsCount > 1 %}
<h2>Previous Entries:</h2>
<section class="postlist">
<div class="postlist-item-container">
	{% for post in postslist | reverse %}
	{% if post.data.title != now.data.title %}
	<article class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}">
		<a href="{{ post.url }}" class="postlist-link">
			<div class="post-image-container">
				<img class="post-image" {% if post.data.imageURL %} src="{{ post.data.imageURL }}" alt="{{ post.data.imageAlt }}" {% else %} src="{{ metadata.defaultPostImageURL }}" alt="{{ metadata.defaultPostImageAlt }}"{% endif %}>
			</div>
		</a>
		<div class="post-copy">
			<a href="{{ post.url }}" class="postlist-link">
				<h3>
					{% if post.data.title %}{{ post.data.title }}{% else %}<code>{{ post.url }}</code>{% endif %}
				</h3>
			</a>
			<time class="postlist-date" datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate("LLLL yyyy") }}</time>
			{% if post.data.synopsis %}<p>{{ post.data.synopsis | truncate(150) | safe }}</p>{% else %}{{ post.content | truncate(150) | safe }}{% endif %}
		</div>
	</article>
	{% endif %}
	{% endfor %}
</div>
{% if morePosts > 0 %}
<a href="/tags/now"><p>See {{ morePosts }} more post{% if morePosts != 1 %}s{% endif %}</a>.</p>
{% endif %}

</section>

{% endif %}
