From 0bd228b0e9ce1bfd816e458744ec50302615acb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Brunet?= Date: Wed, 19 May 2021 09:13:34 +0200 Subject: [PATCH] Make about page editable from CMS --- README.md | 1 + src/_includes/layouts/home.njk | 2 +- src/admin/config.yml | 11 ++++++++++- src/scss/_global.scss | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 69d5afc..904f42a 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ My Online Cookbook is a starter kit to create your own website of recipes, using Demo (this is what you get out of the box) : [https://myonlinecookbook.netlify.app/](https://myonlinecookbook.netlify.app/) Get started now by forking the project or deploy to Netlify : + [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/maeligg/my-online-cookbook&stack=cms) ## Features diff --git a/src/_includes/layouts/home.njk b/src/_includes/layouts/home.njk index 530c417..d23b48e 100644 --- a/src/_includes/layouts/home.njk +++ b/src/_includes/layouts/home.njk @@ -20,7 +20,7 @@ bodyClass: c-home - {% if collections["Favourite ⭐"] %}} + {% if collections["Favourite ⭐"] %}

{{ favouriteRecipes }}

diff --git a/src/admin/config.yml b/src/admin/config.yml index d914aed..91c0263 100644 --- a/src/admin/config.yml +++ b/src/admin/config.yml @@ -41,4 +41,13 @@ collections: - {label: "Author", name: "author", widget: "string"} - {label: "Primary color", name: "primaryColor", widget: "color", hint: "make sure to choose a color that is light enough to display as a background behind dark text"} - {label: "Secondary color", name: "secondaryColor", widget: "color", hint: "used for links and focus styles"} - - {label: "Search label", name: "searchLabel", widget: "string"} \ No newline at end of file + - {label: "Search label", name: "searchLabel", widget: "string"} + - name: "pages" + label: "Pages" + files: + - name: "about" + label: "About page" + file: "src/about.md" + fields: + - {label: "Title", name: "title", widget: "string"} + - {label: "Body", name: "body", widget: "markdown"} \ No newline at end of file diff --git a/src/scss/_global.scss b/src/scss/_global.scss index ddbaf03..e5e9a99 100644 --- a/src/scss/_global.scss +++ b/src/scss/_global.scss @@ -24,6 +24,7 @@ body { main { display: flex; flex-direction: column; + margin-bottom: 30px; } // The x-cloak attribute is automatically removed from elements when Alpine initializes. They should not be visible before then to avoid flickering content