Skip to content

Commit

Permalink
adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Holger Hellinger committed Jan 19, 2024
1 parent 271d9cd commit cd92b3e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Polente Recipes
# Polente Recipes

Find it here: [http://recipe.polente.de/](http://recipe.polente.de/)
2 changes: 1 addition & 1 deletion eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = function (eleventyConfig) {
// Collections
eleventyConfig.addCollection("posts", collections.posts);
eleventyConfig.addCollection("feed", collections.feed);
eleventyConfig.addCollection("curated", collections.curated);
eleventyConfig.addCollection("latest", collections.latest);

// Filters
eleventyConfig.addFilter("dateToDMY", filters.dateToDMY);
Expand Down
8 changes: 2 additions & 6 deletions src/_11ty/collections.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
// Collection for posts
const posts = i => i.getFilteredByGlob("./src/content/posts/*.md").reverse();
const latest = i => i.getFilteredByGlob("./src/content/posts/*.md").reverse().slice(0, 3);
const feed = i => i.getFilteredByGlob("./src/content/posts/*.md").reverse();
const curated = i =>
i
.getAllSorted()
.filter(post => post.data.curated)
.reverse();

module.exports = {
posts,
feed,
curated,
latest,
};
4 changes: 2 additions & 2 deletions src/_includes/layouts/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
</div>
<div class="layout-span layout-span--aside">
<aside class="content-aside flow">
<h2>Curated recipes</h2>
<h2>Latest recipes</h2>
<ul>
{% for item in collections.curated %}
{% for item in collections.latest %}
{% include "partials/site-post-list.njk" %}
{% endfor %}
</ul>
Expand Down
8 changes: 7 additions & 1 deletion src/_includes/partials/site-post-list.njk
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
<li><a href="{{ item.url }}">{{ item.data.title }}</a><time datetime="{{ item.date | dateToYYYYMMDD }}"> {{ item.date | dateToDMY }}</time></li>
<li>
<a href="{{ item.url }}">
{{ item.data.title }}
</a>

<time datetime="{{ item.date | dateToYYYYMMDD }}"> {{ item.date | dateToDMY }}</time>
</li>
7 changes: 7 additions & 0 deletions src/_styles/layout/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,12 @@

ul {
@extend %list-reset;

time {
display: block;
font-style: italic;
text-align: right;
margin-top: 0.25em;
}
}
}
2 changes: 1 addition & 1 deletion src/content/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ pagination:
filter:
- "all"
- "posts"
- "curated"
- "latest"
permalink: "/tag/{{ tag | slug }}/"
---

0 comments on commit cd92b3e

Please sign in to comment.