Make highlighted tag generic + editable
This commit is contained in:
parent
9528e72dfc
commit
e71b7b6e89
|
|
@ -18,12 +18,12 @@ bodyClass: c-home
|
|||
</div>
|
||||
</section>
|
||||
|
||||
{% if collections["Favourite ⭐"] %}
|
||||
{% if collections[highlightedTag] %}
|
||||
<section class="u-bgc-grey-100">
|
||||
<div class="l-container">
|
||||
<h2 class="u-mb-large">{{ favouriteRecipes }}</h2>
|
||||
<h2 class="u-mb-large">{{ highlightedTitle }}</h2>
|
||||
<div class="c-card__wrapper">
|
||||
{% set favouriteRecipes = collections["Favourite ⭐"] | limit(4) %}
|
||||
{% set favouriteRecipes = collections[highlightedTag] | limit(4) %}
|
||||
{% for recipe in favouriteRecipes %}
|
||||
<div class="c-card">
|
||||
{% recipeimage recipe.data.image, "c-card__image", recipe.data.title, "(min-width: 1150px) 25vw, (min-width: 850px) 33vw, (min-width: 550px) 50vw, 100vw" %}
|
||||
|
|
@ -46,6 +46,7 @@ bodyClass: c-home
|
|||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<a href="/tags/{{ highlightedTag | noEmoji | slug }}" class="c-home__highlighted-tag-link">{{ highlightedLinkText }}</a>
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -62,8 +62,9 @@ collections:
|
|||
- {label: "Title", name: "title", widget: "string"}
|
||||
- {label: "Add author to title", name: "authorInTitle", widget: "boolean"}
|
||||
- {label: "Meta title", name: "metaTitle", widget: "string", hint: "used for SEO"}
|
||||
- {label: "Favourite recipes label", name: "favouriteRecipes", widget: "string"}
|
||||
- {label: "Random recipe label", name: "randomRecipe", widget: "string"}
|
||||
- {label: "Highlighted tag", name: "highlightedTag", widget: "string", hint: "This must correspond to one of your recipes' tag !"}
|
||||
- {label: "Title of the highlighted tag section (label)", name: "highlightedTitle", widget: "string"}
|
||||
- {label: "Link text to all recipes with the highlighted tag (label)", name: "highlightedLinkText", widget: "string"}
|
||||
- name: "recipes"
|
||||
label: "All recipes page"
|
||||
file: "src/recipes.md"
|
||||
|
|
|
|||
|
|
@ -3,5 +3,7 @@ layout: layouts/home.njk
|
|||
title: This cookbook belongs to
|
||||
authorInTitle: true
|
||||
metaTitle: Home
|
||||
favouriteRecipes: Some of my favourite recipes
|
||||
highlightedTag: Favourite ⭐
|
||||
highlightedTitle: Some of my favourite recipes
|
||||
highlightedLinkText: All my favourite recipes
|
||||
---
|
||||
|
|
@ -16,4 +16,10 @@
|
|||
padding: 2px 12px;
|
||||
text-decoration: underline dashed;
|
||||
text-underline-offset: 6px;
|
||||
}
|
||||
|
||||
.c-home__highlighted-tag-link {
|
||||
margin-top: 30px;
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
Loading…
Reference in a new issue