--- /dev/null
+<dl>
+{% if maxPosts %}
+ {% set numPosts = collections.activities | length | min(maxPosts) %}
+ {% set activitieslist = collections.activities | reverse | head(numPosts) %}
+{% else %}
+ {% set activitieslist = collections.activities | reverse %}
+{% endif %}
+{%- for item in activitieslist %}
+ <dt><a href="{{ item.url }}">{{ item.data.title }}</a></dt>
+ <dd>
+ {% if "articles" in item.data.tags %}
+ <small class="collectiontag">article</small>
+ {% elseif "reviews" in item.data.tags %}
+ <small class="collectiontag">review</small>
+ {% endif %}
+ {{ item.data.description }}
+ </dd>
+{%- endfor %}
+</dl>
\ No newline at end of file
--- /dev/null
+<dl>
+{% if maxPosts %}
+ {% set numPosts = collections.reviews | length | min(maxPosts) %}
+ {% set reviewslist = collections.reviews | reverse | head(numPosts) %}
+{% else %}
+ {% set reviewslist = collections.reviews | reverse %}
+{% endif %}
+{%- for review in reviewslist %}
+ <dt><a href="{{ review.url }}">{{ review.data.title }}</a></dt>
+ <dd>
+ {% if "movie" in review.data.tags %}
+ <small class="collectiontag">movie</small>
+ {% elseif "music" in review.data.tags %}
+ <small class="collectiontag">music</small>
+ {% elseif "show" in review.data.tags %}
+ <small class="collectiontag">show</small>
+ {% endif %}
+ {{ review.data.description }}
+ </dd>
+{%- endfor %}
+</dl>
\ No newline at end of file
font-size: 1rem;
}
nav {
+ margin-bottom: 1rem;
+}
+nav > h1 {
font-size: 2rem;
font-weight: bold;
}
-nav > a {
+nav > h1 > a {
text-decoration: none;
}
+nav > menu {
+ margin-inline-start: 0;
+ padding-inline-start: 0;
+}
+nav > menu > li {
+ display: inline;
+ padding-right: 1rem;
+}
details {
margin-bottom: 1rem;
}
object {
width: 100%;
}
+hr {
+ margin-bottom: 1rem;
+}
footer {
text-align: center;
font-style: italic;
footer > address > menu > li {
display: inline;
padding-right: 1rem;
+}
+.collectiontag {
+ font-variant: small-caps;
}
\ No newline at end of file
<body>
<header>
<nav>
- <a href="/">{{ metadata.title }}</a>
+ <h1><a href="/">{{ metadata.title }}</a></h1>
+ <menu>
+ <li><a href="/articles">Articles</a></li>
+ <li><a href="/reviews">Reviews</a></li>
+ </menu>
</nav>
</header>
+ <hr>
<main>
{{ content | safe }}
</main>
</section>
<section>
- <h2><a href="/articles">Articles</a></h2>
- {%- include "components/articleslist.njk" %}
+ <h2>Latest Activity</h2>
+ {%- include "components/activitylist.njk" %}
</section>
<section>
--- /dev/null
+---
+layout: layouts/base.njk
+---
+
+<h1>{{ title }}</h1>
+
+<details>
+ <summary>Metadata</summary>
+ <ul>
+ <li>Published: <time datetime="{{ page.date | htmlDateString }}">{{ page.date | htmlDateString }}</time></li>
+ <li>Description: {{ description }}</li>
+ <li>Tags: {{ tags | reject("equalto", "articles") | sort | join(", ") }}</li>
+ {% if posse %}
+ <li>
+ Also Posted To:
+ {% for item in posse %}
+ {% if item["letterboxd"] %}
+ <a href="{{ item["letterboxd"] }}">Letterboxd</a>
+ {% elseif item["goodreads"] %}
+ <a href="{{ item["goodreads"] }}">Goodreads</a>
+ {% endif %}
+ {% endfor %}
+ </li>
+ {% endif %}
+ </ul>
+</details>
+
+<article>
+ {{ content | safe }}
+</article>
--- /dev/null
+---
+layout: layouts/base.njk
+---
+
+<h1>Reviews</h1>
+
+{% include "components/reviewslist.njk" %}
--- /dev/null
+{
+ "tags": ["reviews"],
+ "layout": "layouts/review.njk",
+ "permalink": "reviews/{{ date | htmlDateString }}-{{ title | slugify }}/"
+}
\ No newline at end of file
}
module.exports = function (eleventyConfig) {
+ eleventyConfig.addCollection("activities", function(collectionApi) {
+ let collectionSubset = [
+ ...collectionApi.getFilteredByTag("articles"),
+ ...collectionApi.getFilteredByTag("reviews"),
+ ];
+ let sortedSubset = collectionSubset.sort(function(a, b) {
+ // maintain sort order when working with default collections objects
+ return a.date - b.date;
+ });
+ return sortedSubset;
+ });
eleventyConfig.addFilter("cssmin", function (code) {
return new cleanCSS({}).minify(code).styles;
});