Add stack=cms params in README file, enable editorial workflow and make netlify identity widget only available in homepage

This commit is contained in:
Rémi Weng 2020-10-10 01:00:28 +02:00
parent 32204eb9b0
commit 9c39192352
4 changed files with 21 additions and 5 deletions

View file

@ -121,7 +121,7 @@ Now, your blog is ready to be deployed. All generated files are located at `_sit
Clone this repository on own GitHub account and deploy to Netlify: Clone this repository on own GitHub account and deploy to Netlify:
[![Netlify Deploy button](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/ixartz/Eleventy-Starter-Boilerplate) [![Netlify Deploy button](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/ixartz/Eleventy-Starter-Boilerplate&stack=cms)
### Contributions ### Contributions

View file

@ -2,6 +2,7 @@ backend:
name: git-gateway name: git-gateway
branch: master branch: master
publish_mode: editorial_workflow
media_folder: 'src/assets/images/posts' # Media files will be stored in the repo under src/assets/images/posts media_folder: 'src/assets/images/posts' # Media files will be stored in the repo under src/assets/images/posts
public_folder: '/assets/images/posts' # The src attribute for uploaded media will begin with assets/images/posts public_folder: '/assets/images/posts' # The src attribute for uploaded media will begin with assets/images/posts
@ -11,8 +12,25 @@ collections:
folder: "src/posts" # The path to the folder where the documents are stored folder: "src/posts" # The path to the folder where the documents are stored
create: true # Allow users to create new documents in this collection create: true # Allow users to create new documents in this collection
slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
editor:
preview: false # Disable the editor preview and use instead 'preview links'
fields: # The fields for each document, usually in front matter fields: # The fields for each document, usually in front matter
- { name: "title", label: "Title" } - { name: "title", label: "Title" }
- { name: "description", label: "Description" } - { name: "description", label: "Description" }
- { name: "date", label: "Date", widget: "datetime" } - { name: "date", label: "Date", widget: "datetime" }
- { name: "body", label: "Body", widget: "markdown" } - { name: "body", label: "Body", widget: "markdown" }
- name: "config"
label: "Configuration"
editor:
preview: false
files:
- name: "global"
label: "Global"
file: "src/_data/site.json"
fields:
- { name: "site_name", label: "Site name" }
- { name: "title", label: "Site title" }
- { name: "description", label: "Site description" }
- { name: "url", label: "Site url" }
- { name: "locale", label: "Language" }
- { name: "author", label: "Author" }

View file

@ -10,8 +10,5 @@
<!-- Include the script that builds the page and powers Netlify CMS --> <!-- Include the script that builds the page and powers Netlify CMS -->
<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script> <script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script> <script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
<script>
CMS.registerPreviewStyle('/assets/styles/main.css');
</script>
</body> </body>
</html> </html>

View file

@ -46,7 +46,7 @@
"@context": "http://schema.org" "@context": "http://schema.org"
} }
</script> </script>
<% } %> <%- include('webpack.ejs') %> <% } %><%- include('webpack.ejs') %> <% if (page.url == "/") { %>
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script> <script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
<script> <script>
if (window.netlifyIdentity) { if (window.netlifyIdentity) {
@ -59,6 +59,7 @@
}); });
} }
</script> </script>
<% } %>
</head> </head>
<body class="antialiased w-full text-gray-700"> <body class="antialiased w-full text-gray-700">