From a2c1db460685bba02b89425f885c4140768d09ef Mon Sep 17 00:00:00 2001 From: Aron Gates Date: Thu, 24 Nov 2022 00:23:56 +0000 Subject: [PATCH] changing from post to recipe --- .eleventy.js | 1 + _data/metadata.json | 14 +++++++------- about/index.md | 4 +--- feed/feed.njk | 20 ++++++++++---------- feed/json.njk | 14 +++++++------- index.njk | 40 +++++++++++++++++++++++++++++++++------- 6 files changed, 59 insertions(+), 34 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index ae97a0639..97ceeea10 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -79,6 +79,7 @@ module.exports = function (eleventyConfig) { eleventyConfig.addPlugin(require("./_11ty/apply-csp.js")); eleventyConfig.setDataDeepMerge(true); eleventyConfig.addLayoutAlias("post", "layouts/post.njk"); + eleventyConfig.addLayoutAlias("recipe", "layouts/recipe.njk"); eleventyConfig.addNunjucksAsyncFilter( "addHash", function (absolutePath, callback) { diff --git a/_data/metadata.json b/_data/metadata.json index c306a8189..1a12a12f1 100755 --- a/_data/metadata.json +++ b/_data/metadata.json @@ -1,10 +1,10 @@ { - "title": "Title of the website. Update me.", + "title": "Csillagok Receptek", "url": "https://update-me.com", "domain": "update-me.com", - "description": "Description of the website. Update me.", - "genre": "Insert a schema.org genre", - "googleAnalyticsId": "GA ID. Update me. Note, that this is not compatible with the not-yet-commonly used version 4 of Google Analytics", + "description": "All you can eat recipes created by Geczy Csilla!", + "genre": "Recipe", + "googleAnalyticsId": "GA ID. Update me", "sendWebVitals": false, "feed": { "subtitle": "Subtitle. Update me.", @@ -17,10 +17,10 @@ "url": "https://update-me.com/feed/feed.json" }, "author": { - "name": "Author Name. Update me.", + "name": "Geczy, Csilla", "twitterHandle": "update_me" }, "publisher": { - "name": "Publisher name. Update me." + "name": "Geczy, Csilla" } -} +} \ No newline at end of file diff --git a/about/index.md b/about/index.md index b00f9572e..3faf819af 100644 --- a/about/index.md +++ b/about/index.md @@ -7,6 +7,4 @@ eleventyNavigation: order: 3 --- -I am a person that writes stuff. - -This blog template is based on [eleventy-high-performance-blog](https://www.industrialempathy.com/posts/eleventy-high-performance-blog/) which itself is based on [eleventy-base-blog](https://github.com/11ty/eleventy-base-blog). +I am a person that loves to cook. diff --git a/feed/feed.njk b/feed/feed.njk index 97b9f202b..3706a453c 100755 --- a/feed/feed.njk +++ b/feed/feed.njk @@ -15,19 +15,19 @@ eleventyExcludeFromCollections: true {{ metadata.author.name }} {{ metadata.author.email }} - {%- for post in collections.recipes %} - {% set absolutePostUrl %}{{ post.url | url | absoluteUrl(metadata.url) }}{% endset %} + {%- for recipe in collections.recipes %} + {% set absoluteRecipeUrl %}{{ recipe.url | url | absoluteUrl(metadata.url) }}{% endset %} - {{ post.data.title }} - - {{ post.date | rssDate }} - {{ absolutePostUrl }} + {{ recipe.data.title }} + + {{ recipe.date | rssDate }} + {{ absoluteRecipeUrl }} - {{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }} + {{ recipe.templateContent | htmlToAbsoluteUrls(absoluteRecipeUrl) }} {% if googleanalytics %} - {% set titleUrlEncoded = post.data.title|encodeURIComponent %} - {% set urlUrlEncoded = post.url | encodeURIComponent %} - {{''}} + {% set titleUrlEncoded = recipe.data.title|encodeURIComponent %} + {% set urlUrlEncoded = recipe.url | encodeURIComponent %} + {{''}} {% endif %} diff --git a/feed/json.njk b/feed/json.njk index 043323158..962d7d6a3 100644 --- a/feed/json.njk +++ b/feed/json.njk @@ -14,14 +14,14 @@ eleventyExcludeFromCollections: true "url": "{{ metadata.author.url }}" }, "items": [ - {%- for post in collections.recipes | reverse %} - {%- set absolutePostUrl %}{{ post.url | url | absoluteUrl(metadata.url) }}{% endset -%} + {%- for recipe in collections.recipes | reverse %} + {%- set absoluteRecipeUrl %}{{ recipe.url | url | absoluteUrl(metadata.url) }}{% endset -%} { - "id": "{{ absolutePostUrl }}", - "url": "{{ absolutePostUrl }}", - "title": "{{ post.data.title }}", - "content_html": {% if post.templateContent %}{{ post.templateContent | dump | safe }}{% else %}""{% endif %}, - "date_published": "{{ post.date | rssDate }}" + "id": "{{ absoluteRecipeUrl }}", + "url": "{{ absoluteRecipeUrl }}", + "title": "{{ recipe.data.title }}", + "content_html": {% if recipe.templateContent %}{{ recipe.templateContent | dump | safe }}{% else %}""{% endif %}, + "date_published": "{{ recipe.date | rssDate }}" } {%- if not loop.last -%} , diff --git a/index.njk b/index.njk index 7aba0672a..903591e3d 100644 --- a/index.njk +++ b/index.njk @@ -1,18 +1,44 @@ --- -title: Title. Update me. +title: Csillagok Receptek layout: layouts/home.njk -description: Description. Update me. +description: All you can eat recipes created by Geczy Csilla! image: https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg date: Last Modified +pagination: + data: collections.recipes + size: 9 + alias: recipes + reverse: true ---

- This is a demo website based on - eleventy-high-performance-blog. + This is a recipe website of Csilla's original recipes. These were first posted on + cookpad.hu

-

recipes

- {% set recipeslist = collections.recipes %} +

Recipes

+

+ Previous + {%- for pageEntry in pagination.pages %} + {{ loop.index }} + {%- endfor %} + Next +

+ {% set recipeslist = recipes %} {% include "recipeslist.njk" %} -
\ No newline at end of file +

+ Previous + {%- for pageEntry in pagination.pages %} + {{ loop.index }} + {%- endfor %} + Next +

+ + +