Compare commits
9 Commits
bc50ad1a07
...
prod
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ad39d04d8 | ||
|
|
01c731609f | ||
|
|
4e94e69154 | ||
|
|
baaf6e832a | ||
|
|
81681b921f | ||
|
|
956edcdde0 | ||
|
|
f9df567975 | ||
|
|
44324ec311 | ||
|
|
e6fde24c2c |
@@ -1,8 +1,56 @@
|
||||
module.exports = function(eleventyConfig) {
|
||||
eleventyConfig.addPassthroughCopy("src/css"); // Copy css to site folder
|
||||
eleventyConfig.setServerOptions({
|
||||
host: "0.0.0.0",
|
||||
port: 8080
|
||||
port: 80
|
||||
});
|
||||
eleventyConfig.addWatchTarget("byTag"), (collection, tag) => {
|
||||
return collection.filter(item => item.data.tags && item.data.tags.includes(tag));
|
||||
};
|
||||
eleventyConfig.addFilter("filterTags", (tags) => {
|
||||
return (tags || []).filter(tag => !["recipe", "all", "nav"].includes(tag));
|
||||
});
|
||||
|
||||
eleventyConfig.addCollection("recipesByTag", function(collectionApi) {
|
||||
const recipes = collectionApi.getFilteredByTag("recipe");
|
||||
const tagMap = {};
|
||||
|
||||
recipes.forEach(recipe => {
|
||||
const customTags = (recipe.data.tags || []).filter(t => !["recipe", "all", "nav"].includes(t));
|
||||
const tagsToUse = customTags.length > 0 ? customTags : ["other"];
|
||||
|
||||
tagsToUse.forEach(tag => {
|
||||
if (!tagMap[tag]) {
|
||||
tagMap[tag] = [];
|
||||
}
|
||||
tagMap[tag].push(recipe);
|
||||
});
|
||||
});
|
||||
|
||||
return Object.keys(tagMap).sort().map(tag => ({
|
||||
tagName: tag,
|
||||
recipes: tagMap[tag].sort((a, b) => (a.data.title || "").localeCompare(b.data.title || ""))
|
||||
}));
|
||||
});
|
||||
|
||||
eleventyConfig.addCollection("recipesByAuthor", function(collectionApi) {
|
||||
const recipes = collectionApi.getFilteredByTag("recipe");
|
||||
const authorMap = {};
|
||||
|
||||
recipes.forEach(recipe => {
|
||||
const author = (recipe.data.author || "Unknown Cook").trim();
|
||||
if (!authorMap[author]) {
|
||||
authorMap[author] = [];
|
||||
}
|
||||
authorMap[author].push(recipe);
|
||||
});
|
||||
|
||||
return Object.keys(authorMap).sort().map(author => ({
|
||||
authorName: author,
|
||||
recipes: authorMap[author].sort((a, b) => (a.data.title || "").localeCompare(b.data.title || ""))
|
||||
}));
|
||||
});
|
||||
|
||||
return {
|
||||
dir: {
|
||||
input: "src", // Where your markdown files live
|
||||
|
||||
33
src/_layouts/home.njk
Normal file
33
src/_layouts/home.njk
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ title }}</title>
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="Header">
|
||||
<h1>Great Johnson Family Recipe Index</h1>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/printable-recipes/" target="_blank">Printable PDF</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container">
|
||||
{{ content | safe }}
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<p>2026 Family Recipes</p>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{{ title }}
|
||||
|
||||
|
||||
|
||||
Home
|
||||
|
||||
|
||||
|
||||
{{ content | safe }}
|
||||
@@ -1,9 +1,60 @@
|
||||
{{ title }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ title }} - Family Recipes</title>
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header class="site-nav-header">
|
||||
<div class="Header">
|
||||
<h1><a href="/">Family Recipes</a></h1>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/recipies/">Recipes</a></li>
|
||||
<li><a href="/printable-recipes/" target="_blank">Printable PDF</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container">
|
||||
<article class="recipe-card-page">
|
||||
<div class="recipe-header">
|
||||
<div class="recipe-title-section">
|
||||
<h1 class="recipe-title">{{ title | upper }}</h1>
|
||||
{% if author %}
|
||||
<p class="recipe-author">From the kitchen of: <em>{{ author }}</em></p>
|
||||
{% endif %}
|
||||
{% if tags %}
|
||||
{% for tag in tags | filterTags %}
|
||||
<span class="tag-badge">{{ tag }}</span>{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if image %}
|
||||
<div class="recipe-illustration">
|
||||
<img src="{{ image }}" alt="{{ title }}">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<hr class="recipe-divider">
|
||||
|
||||
<div class="recipe-body">
|
||||
{{ content | safe }}
|
||||
</div>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<p>© 2026 Family Recipes</p>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
Home
|
||||
|
||||
|
||||
|
||||
{{ content | safe }}
|
||||
|
||||
398
src/css/style.css
Normal file
398
src/css/style.css
Normal file
@@ -0,0 +1,398 @@
|
||||
/* Warm, cozy recipe card theme */
|
||||
:root {
|
||||
--primary-color: #b45309; /* Warm amber / terracotta */
|
||||
--primary-hover: #883905;
|
||||
--bg-color: #f7f4ee; /* Soft warm linen background */
|
||||
--card-bg: #ffffff; /* Crisp paper white */
|
||||
--text-color: #292524; /* Soft warm charcoal */
|
||||
--border-color: #e7e0d3; /* Gentle warm border */
|
||||
--font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
|
||||
--font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: var(--font-sans);
|
||||
background-color: var(--bg-color);
|
||||
color: var(--text-color);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
/* Container */
|
||||
.container {
|
||||
max-width: 820px;
|
||||
margin: 0 auto;
|
||||
padding: 0 1.25rem;
|
||||
}
|
||||
|
||||
/* Header & Navigation */
|
||||
header {
|
||||
background-color: #ffffff;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
padding: 1.1rem 0;
|
||||
margin-bottom: 2.5rem;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
|
||||
.Header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
max-width: 820px;
|
||||
margin: 0 auto;
|
||||
padding: 0 1.25rem;
|
||||
}
|
||||
|
||||
header h1 {
|
||||
margin: 0;
|
||||
font-size: 1.5rem;
|
||||
font-family: var(--font-serif);
|
||||
}
|
||||
|
||||
header h1 a {
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
nav ul {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
gap: 1.75rem;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
nav a {
|
||||
color: var(--text-color);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
font-size: 0.95rem;
|
||||
transition: color 0.15s ease;
|
||||
}
|
||||
|
||||
nav a:hover {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
/* Content Area */
|
||||
main, .Content {
|
||||
min-height: 65vh;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
footer, .Footer {
|
||||
border-top: 1px solid var(--border-color);
|
||||
margin-top: 4rem;
|
||||
padding: 2.5rem 0;
|
||||
text-align: center;
|
||||
color: #78716c;
|
||||
font-size: 0.9rem;
|
||||
background-color: #faf8f5;
|
||||
}
|
||||
|
||||
/* Recipe Cards Grid */
|
||||
.recipe-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
||||
gap: 1.5rem;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.recipe-card {
|
||||
background-color: var(--card-bg);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 10px;
|
||||
padding: 1.5rem;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
min-height: 140px;
|
||||
}
|
||||
|
||||
|
||||
.recipe-card:hover {
|
||||
transform: translateY(-3px);
|
||||
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.recipe-card h3 {
|
||||
font-family: var(--font-serif);
|
||||
font-size: 1.25rem;
|
||||
margin: 0 0 0.5rem 0;
|
||||
}
|
||||
|
||||
.recipe-card h3 a {
|
||||
color: #1c1917;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.recipe-card h3 a:hover {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
|
||||
/* Classic Printed Recipe Page Layout */
|
||||
.recipe-card-page {
|
||||
background-color: #ffffff;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 12px;
|
||||
padding: 3rem 2.5rem;
|
||||
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.recipe-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.recipe-title-section {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.recipe-title {
|
||||
font-family: var(--font-serif);
|
||||
font-size: 2.1rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.03em;
|
||||
margin: 0 0 0.4rem 0;
|
||||
color: #1c1917;
|
||||
}
|
||||
|
||||
.recipe-author {
|
||||
font-size: 1rem;
|
||||
color: #78716c;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.recipe-author em {
|
||||
font-style: italic;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.recipe-illustration {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border: 1px dashed #d6cebe;
|
||||
border-radius: 8px;
|
||||
padding: 6px;
|
||||
background: #faf8f5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.recipe-illustration img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.recipe-divider {
|
||||
border: none;
|
||||
border-top: 2px solid var(--border-color);
|
||||
margin: 1.5rem 0 2.25rem 0;
|
||||
}
|
||||
|
||||
.recipe-body h2,
|
||||
.recipe-body h3 {
|
||||
font-family: var(--font-serif);
|
||||
font-size: 1.15rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
margin-top: 1.75rem;
|
||||
margin-bottom: 0.75rem;
|
||||
color: var(--primary-color);
|
||||
border-bottom: 1px solid #f2ece1;
|
||||
padding-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.recipe-body ul {
|
||||
padding-left: 1.25rem;
|
||||
margin-bottom: 1.75rem;
|
||||
}
|
||||
|
||||
.recipe-body li {
|
||||
margin-bottom: 0.4rem;
|
||||
color: #44403c;
|
||||
}
|
||||
|
||||
.recipe-body p {
|
||||
margin-bottom: 1.25rem;
|
||||
color: #292524;
|
||||
}
|
||||
|
||||
.tag-badge {
|
||||
display: inline-block;
|
||||
padding-right: 0.4rem;
|
||||
padding-top: 0.5rem;
|
||||
color: #b45309;
|
||||
}
|
||||
|
||||
/* Print & PDF Export Styles */
|
||||
@media print {
|
||||
@page {
|
||||
size: portrait;
|
||||
margin: 0.5in;
|
||||
}
|
||||
|
||||
header, footer, .no-print {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #ffffff !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 100% !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.printable-recipe-card {
|
||||
page-break-before: always !important;
|
||||
break-before: page !important;
|
||||
page-break-after: always !important;
|
||||
break-after: page !important;
|
||||
page-break-inside: avoid !important;
|
||||
break-inside: avoid !important;
|
||||
height: 100vh !important;
|
||||
max-height: 100vh !important;
|
||||
box-sizing: border-box !important;
|
||||
overflow: hidden !important;
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
padding: 0.5rem 0 !important;
|
||||
margin: 0 !important;
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
justify-content: flex-start !important;
|
||||
}
|
||||
|
||||
.printable-recipe-card:first-child {
|
||||
page-break-before: auto !important;
|
||||
break-before: auto !important;
|
||||
}
|
||||
|
||||
.printable-recipe-card .recipe-title {
|
||||
font-size: 1.5rem !important;
|
||||
margin-bottom: 0.2rem !important;
|
||||
}
|
||||
|
||||
.printable-recipe-card .recipe-author {
|
||||
font-size: 0.85rem !important;
|
||||
}
|
||||
|
||||
.printable-recipe-card .recipe-illustration {
|
||||
width: 60px !important;
|
||||
height: 60px !important;
|
||||
padding: 3px !important;
|
||||
}
|
||||
|
||||
.printable-recipe-card .recipe-divider {
|
||||
margin: 0.5rem 0 0.75rem 0 !important;
|
||||
}
|
||||
|
||||
.printable-recipe-card .recipe-body h2,
|
||||
.printable-recipe-card .recipe-body h3 {
|
||||
font-size: 0.95rem !important;
|
||||
margin-top: 0.75rem !important;
|
||||
margin-bottom: 0.3rem !important;
|
||||
padding-bottom: 0.15rem !important;
|
||||
}
|
||||
|
||||
.printable-recipe-card .recipe-body p,
|
||||
.printable-recipe-card .recipe-body li {
|
||||
font-size: 0.82rem !important;
|
||||
line-height: 1.35 !important;
|
||||
margin-bottom: 0.2rem !important;
|
||||
}
|
||||
|
||||
.printable-recipe-card .recipe-body ul,
|
||||
.printable-recipe-card .recipe-body ol {
|
||||
margin-bottom: 0.6rem !important;
|
||||
padding-left: 1.2rem !important;
|
||||
}
|
||||
|
||||
.category-header-card {
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
text-align: center !important;
|
||||
background-color: #faf8f5 !important;
|
||||
border: 2px solid var(--border-color) !important;
|
||||
}
|
||||
|
||||
.category-header-content {
|
||||
margin: auto 0;
|
||||
}
|
||||
|
||||
.category-label {
|
||||
font-size: 0.9rem !important;
|
||||
letter-spacing: 0.25em !important;
|
||||
color: var(--primary-color) !important;
|
||||
font-weight: 700 !important;
|
||||
}
|
||||
|
||||
.category-header-title {
|
||||
font-size: 2.8rem !important;
|
||||
font-family: var(--font-serif) !important;
|
||||
color: #1c1917 !important;
|
||||
margin: 0.5rem 0 !important;
|
||||
letter-spacing: 0.05em !important;
|
||||
}
|
||||
|
||||
.category-count {
|
||||
font-size: 1.1rem !important;
|
||||
color: #78716c !important;
|
||||
font-style: italic !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Category header web styles */
|
||||
.category-header-card {
|
||||
min-height: 300px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
background-color: #faf8f5;
|
||||
border: 2px solid var(--border-color);
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
.category-label {
|
||||
display: block;
|
||||
font-size: 0.85rem;
|
||||
letter-spacing: 0.25em;
|
||||
color: var(--primary-color);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.category-header-title {
|
||||
font-size: 2.5rem;
|
||||
font-family: var(--font-serif);
|
||||
color: #1c1917;
|
||||
margin: 0.4rem 0;
|
||||
}
|
||||
|
||||
.category-count {
|
||||
font-size: 1rem;
|
||||
color: #78716c;
|
||||
font-style: italic;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
47
src/index.md
47
src/index.md
@@ -1,17 +1,40 @@
|
||||
---
|
||||
layout: note.njk
|
||||
title: My First Note
|
||||
layout: home.njk
|
||||
title: Homepage
|
||||
---
|
||||
# Welcome to my notes!
|
||||
# Great Johnshon Family Recipies
|
||||
|
||||
This is a basic Eleventy setup. Any Markdown file you place in the `src` folder will automatically be converted to a page.
|
||||
An index of family recipes collected over generations.
|
||||
|
||||
* It supports lists
|
||||
* **Bold text**
|
||||
* [Links](https://11ty.dev)
|
||||
|
||||
<ul>
|
||||
{% for recipe in collections.recipe %}
|
||||
<li><a href="{{ recipe.url }}">{{ recipe.data.title }}</a></li>
|
||||
<div class="sort-controls">
|
||||
Sort by:
|
||||
<button onclick="sortGrid('title')">Title</button>
|
||||
<button onclick="sortGrid('author')">Author</button>
|
||||
</div>
|
||||
<script>
|
||||
function sortGrid(attr) {
|
||||
const grid = document.querySelector('.recipe-grid');
|
||||
const cards = Array.from(grid.children);
|
||||
cards.sort((a, b) => {
|
||||
const valA = (a.dataset[attr] || '').trim();
|
||||
const valB = (b.dataset[attr] || '').trim();
|
||||
if (!valA && valB) return 1;
|
||||
if (valA && !valB) return -1;
|
||||
return valA.localeCompare(valB);
|
||||
});
|
||||
cards.forEach(card => grid.appendChild(card));
|
||||
}
|
||||
</script>
|
||||
<div class="recipe-grid">
|
||||
{% for recipe in collections.recipe | sort(attribute="data.title") %}
|
||||
<article class="recipe-card" data-title="{{ recipe.data.title | default: '' }}" data-author="{{ recipe.data.author | default: 'Unknown Author' }}">
|
||||
<h3><a href="{{ recipe.url }}">{{ recipe.data.title }}</a></h3>
|
||||
<p class="recipe-author">From the kitchen of: <em>{{ recipe.data.author | default: 'Unknown Author' }}</em></p>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
162
src/printable-recipes.njk
Normal file
162
src/printable-recipes.njk
Normal file
@@ -0,0 +1,162 @@
|
||||
---
|
||||
layout: home.njk
|
||||
title: Printable Family Recipes
|
||||
permalink: "/printable-recipes/"
|
||||
---
|
||||
|
||||
<div class="no-print" style="margin-bottom: 2rem; background: #ffffff; padding: 1.25rem; border-radius: 10px; border: 1px solid var(--border-color); text-align: center;">
|
||||
<h2 style="margin-top: 0; margin-bottom: 1rem; font-family: var(--font-serif); font-size: 1.25rem;">Print & Export Options</h2>
|
||||
|
||||
<div style="display: flex; gap: 0.75rem; justify-content: center; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap;">
|
||||
<label style="font-weight: 600;">Layout Mode:</label>
|
||||
<button id="btn-alphabetical" onclick="switchView('alphabetical')" style="padding: 0.5rem 1rem; font-size: 0.95rem; font-weight: 600; background-color: var(--primary-color); color: white; border: none; border-radius: 6px; cursor: pointer;">
|
||||
Alphabetical (A–Z)
|
||||
</button>
|
||||
<button id="btn-grouped-tag" onclick="switchView('grouped-tag')" style="padding: 0.5rem 1rem; font-size: 0.95rem; font-weight: 500; background-color: #e7e0d3; color: var(--text-color); border: none; border-radius: 6px; cursor: pointer;">
|
||||
Grouped by Category / Tag
|
||||
</button>
|
||||
<button id="btn-grouped-author" onclick="switchView('grouped-author')" style="padding: 0.5rem 1rem; font-size: 0.95rem; font-weight: 500; background-color: #e7e0d3; color: var(--text-color); border: none; border-radius: 6px; cursor: pointer;">
|
||||
Grouped by Cook / Author
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button onclick="window.print()" style="padding: 0.75rem 1.75rem; font-size: 1rem; font-weight: 600; background-color: var(--primary-color); color: white; border: none; border-radius: 6px; cursor: pointer;">
|
||||
🖨️ Print / Save as PDF
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Alphabetical View -->
|
||||
<div id="view-alphabetical" class="printable-recipes-container">
|
||||
{% for recipe in collections.recipe | sort(attribute="data.title") %}
|
||||
<article class="recipe-card-page printable-recipe-card">
|
||||
<div class="recipe-header">
|
||||
<div class="recipe-title-section">
|
||||
<h1 class="recipe-title">{{ recipe.data.title | upper }}</h1>
|
||||
{% if recipe.data.author %}
|
||||
<p class="recipe-author">From the kitchen of: <em>{{ recipe.data.author }}</em></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if recipe.data.image %}
|
||||
<div class="recipe-illustration">
|
||||
<img src="{{ recipe.data.image }}" alt="{{ recipe.data.title }}">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<hr class="recipe-divider">
|
||||
|
||||
<div class="recipe-body">
|
||||
{{ recipe.templateContent | safe }}
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- Grouped by Tag View -->
|
||||
<div id="view-grouped-tag" class="printable-recipes-container" style="display: none;">
|
||||
{% for group in collections.recipesByTag %}
|
||||
<!-- Category Cover Header Page -->
|
||||
<article class="recipe-card-page printable-recipe-card category-header-card">
|
||||
<div class="category-header-content">
|
||||
<span class="category-label">CATEGORY</span>
|
||||
<h1 class="category-header-title">{{ group.tagName | upper }}</h1>
|
||||
<p class="category-count">{{ group.recipes.length }} Recipes</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
{% for recipe in group.recipes %}
|
||||
<article class="recipe-card-page printable-recipe-card">
|
||||
<div class="recipe-header">
|
||||
<div class="recipe-title-section">
|
||||
<h1 class="recipe-title">{{ recipe.data.title | upper }}</h1>
|
||||
{% if recipe.data.author %}
|
||||
<p class="recipe-author">From the kitchen of: <em>{{ recipe.data.author }}</em></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if recipe.data.image %}
|
||||
<div class="recipe-illustration">
|
||||
<img src="{{ recipe.data.image }}" alt="{{ recipe.data.title }}">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<hr class="recipe-divider">
|
||||
|
||||
<div class="recipe-body">
|
||||
{{ recipe.templateContent | safe }}
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- Grouped by Author View -->
|
||||
<div id="view-grouped-author" class="printable-recipes-container" style="display: none;">
|
||||
{% for group in collections.recipesByAuthor %}
|
||||
<!-- Author Cover Header Page -->
|
||||
<article class="recipe-card-page printable-recipe-card category-header-card">
|
||||
<div class="category-header-content">
|
||||
<span class="category-label">FROM THE KITCHEN OF</span>
|
||||
<h1 class="category-header-title">{{ group.authorName | upper }}</h1>
|
||||
<p class="category-count">{{ group.recipes.length }} Recipes</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
{% for recipe in group.recipes %}
|
||||
<article class="recipe-card-page printable-recipe-card">
|
||||
<div class="recipe-header">
|
||||
<div class="recipe-title-section">
|
||||
<h1 class="recipe-title">{{ recipe.data.title | upper }}</h1>
|
||||
{% if recipe.data.author %}
|
||||
<p class="recipe-author">From the kitchen of: <em>{{ recipe.data.author }}</em></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if recipe.data.image %}
|
||||
<div class="recipe-illustration">
|
||||
<img src="{{ recipe.data.image }}" alt="{{ recipe.data.title }}">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<hr class="recipe-divider">
|
||||
|
||||
<div class="recipe-body">
|
||||
{{ recipe.templateContent | safe }}
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function switchView(mode) {
|
||||
const alphaView = document.getElementById('view-alphabetical');
|
||||
const tagView = document.getElementById('view-grouped-tag');
|
||||
const authorView = document.getElementById('view-grouped-author');
|
||||
|
||||
const btnAlpha = document.getElementById('btn-alphabetical');
|
||||
const btnTag = document.getElementById('btn-grouped-tag');
|
||||
const btnAuthor = document.getElementById('btn-grouped-author');
|
||||
|
||||
[alphaView, tagView, authorView].forEach(v => v.style.display = 'none');
|
||||
[btnAlpha, btnTag, btnAuthor].forEach(b => {
|
||||
b.style.backgroundColor = '#e7e0d3';
|
||||
b.style.color = 'var(--text-color)';
|
||||
b.style.fontWeight = '500';
|
||||
});
|
||||
|
||||
if (mode === 'grouped-tag') {
|
||||
tagView.style.display = 'block';
|
||||
btnTag.style.backgroundColor = 'var(--primary-color)';
|
||||
btnTag.style.color = 'white';
|
||||
btnTag.style.fontWeight = '600';
|
||||
} else if (mode === 'grouped-author') {
|
||||
authorView.style.display = 'block';
|
||||
btnAuthor.style.backgroundColor = 'var(--primary-color)';
|
||||
btnAuthor.style.color = 'white';
|
||||
btnAuthor.style.fontWeight = '600';
|
||||
} else {
|
||||
alphaView.style.display = 'block';
|
||||
btnAlpha.style.backgroundColor = 'var(--primary-color)';
|
||||
btnAlpha.style.color = 'white';
|
||||
btnAlpha.style.fontWeight = '600';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user