Skip to content

Commit

Permalink
STyling
Browse files Browse the repository at this point in the history
  • Loading branch information
Holger Hellinger committed Jan 19, 2024
1 parent a45fcfd commit fd2160c
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 7 deletions.
2 changes: 1 addition & 1 deletion eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addCollection("posts", collections.posts);
eleventyConfig.addCollection("feed", collections.feed);
eleventyConfig.addCollection("latest", collections.latest);
eleventyConfig.addCollection("spot", collections.spot);
eleventyConfig.addCollection("featured", collections.featured);

// Filters
eleventyConfig.addFilter("dateToDMY", filters.dateToDMY);
Expand Down
4 changes: 2 additions & 2 deletions src/_11ty/collections.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// 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 spot = i => i.getFilteredByGlob("./src/content/posts/*.md").reverse().slice(0, 1);
const featured = i => i.getFilteredByGlob("./src/content/posts/*.md").reverse().slice(0, 1);
const feed = i => i.getFilteredByGlob("./src/content/posts/*.md").reverse();

module.exports = {
posts,
feed,
latest,
spot,
featured,
};
10 changes: 9 additions & 1 deletion src/_includes/layouts/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
<h2>Latest recipes</h2>
<ul class="recipe-ul">
{% for item in collections.latest %}
{% include "partials/site-post-list.njk" %}
<li>
<a href="{{ item.url }}">
{% figure %}
{% picture item.data.figureRecipe.imageSrc, item.data.figureRecipe.imageTitle, item.data.figureRecipe.imageAlt, item.data.figureRecipe.loading, "(min-width: 60rem) 260px, 340px" %}
{% endfigure %}
{{ item.data.title }}
</a>
<time datetime="{{ item.date | dateToYYYYMMDD }}"> {{ item.date | dateToDMY }}</time>
</li>
{% endfor %}
</ul>
</aside>
Expand Down
9 changes: 7 additions & 2 deletions src/_includes/layouts/list.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
<h1 class="page-header layout-span">{{ title }}</h1>
<div class="layout-span | content-main flow">
<ul class="recipe-ul">
{% for item in pagination.items %}
{% include "partials/site-post-list.njk" %}
{% for item in pagination.items %}
<a href="{{ item.url }}">
{% figure %}
{% picture item.data.figureRecipe.imageSrc, item.data.figureRecipe.imageTitle, item.data.figureRecipe.imageAlt, item.data.figureRecipe.loading, "(min-width: 60rem) 250px, (min-width: 30rem) 440px, 430px" %}
{% endfigure %}
{{ item.data.title }}
</a>
{% endfor %}
</ul>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/_styles/base/sections.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ h1 {

h2 {
@extend %heading-2;
margin-bottom: 0.25em;
}

h3 {
Expand Down
9 changes: 9 additions & 0 deletions src/_styles/components/recipe-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,21 @@ ul.recipe-ul {
ul.recipe-ul {
grid-template-columns: 1fr 1fr;
}
aside ul.recipe-ul {
grid-template-columns: 1fr 1fr;
}
}

@media only screen and (min-width: 960px) {
ul.recipe-ul {
grid-template-columns: 1fr 1fr 1fr 1fr;
}
aside ul.recipe-ul {
grid-template-columns: 1fr 1fr 1fr;
}
}

@media only screen and (min-width: 1100px) {
aside ul.recipe-ul {
grid-template-columns: 1fr;
}
Expand Down
1 change: 0 additions & 1 deletion src/_styles/layout/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@
padding: var(--space-l);
border-radius: var(--border-radius-small);
background-color: var(--color-surface-secondary);
max-width: var(--measure-default);
}
9 changes: 9 additions & 0 deletions src/content/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
---
layout: "layouts/index"
permalink: "/index.html"
eleventyImport:
collections: ["featured"]
---

Welcome to our AI-Generated Vegan Recipe Page, a unique culinary destination where the fusion of technology and diverse global flavors brings you an exclusive range of vegan recipes. We are thrilled to introduce you to our four AI-created chef personas, each representing a different corner of the world, infusing their unique cultural touch into vegan cooking.

## Newest Recipe

{% set latestRecipe = collections.featured[0].data %}
<a class="index" href="{{ collections.featured[0].url }}">
{% figure %}
{% picture latestRecipe.figureRecipe.imageSrc, latestRecipe.figureRecipe.imageTitle, latestRecipe.figureRecipe.imageAlt, latestRecipe.figureRecipe.loading %}
{% endfigure %}
</a>

## Meet Our Chefs

Expand Down

0 comments on commit fd2160c

Please sign in to comment.