Change netlify config slug and add preview style in admin
This commit is contained in:
parent
ec409e62e2
commit
213da09b55
9 changed files with 21 additions and 7 deletions
|
|
@ -10,7 +10,7 @@ collections:
|
|||
label: "Blog" # Used in the UI
|
||||
folder: "src/posts" # The path to the folder where the documents are stored
|
||||
create: true # Allow users to create new documents in this collection
|
||||
slug: "{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
|
||||
slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
|
||||
fields: # The fields for each document, usually in front matter
|
||||
- { name: "title", label: "Title" }
|
||||
- { name: "description", label: "Description" }
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@
|
|||
<!-- 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 async src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
|
||||
<script>
|
||||
CMS.registerPreviewStyle("/styles/main.css");
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -48,6 +48,17 @@
|
|||
</script>
|
||||
<% } %> <%- include('webpack.ejs') %>
|
||||
<script async src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
|
||||
<script>
|
||||
if (window.netlifyIdentity) {
|
||||
window.netlifyIdentity.on('init', (user) => {
|
||||
if (!user) {
|
||||
window.netlifyIdentity.on('login', () => {
|
||||
document.location.href = '/admin/';
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="antialiased w-full text-gray-700">
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: 'My first post'
|
||||
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
date: 2020-02-02 00:00:00
|
||||
date: 2020-02-02T00:00:00Z
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: 'My second post'
|
||||
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
date: 2020-03-03 00:00:00
|
||||
date: 2020-03-03T00:00:00Z
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: 'Eleventy Starter Boilerplate Presentation'
|
||||
description: Everything you need to use this Eleventy Boilerplate template
|
||||
date: 2020-05-05 00:00:00
|
||||
date: 2020-05-05T00:00:00Z
|
||||
---
|
||||
|
||||
[](https://creativedesignsguru.com/demo/Eleventy-Starter-Boilerplate/)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: 'My third post'
|
||||
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
date: 2020-06-06 00:00:00
|
||||
date: 2020-06-06T00:00:00Z
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: 'My forth post'
|
||||
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
date: 2020-07-07 00:00:00
|
||||
date: 2020-07-07T00:00:00Z
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: 'My fifth post'
|
||||
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
date: 2020-08-08 00:00:00
|
||||
date: 2020-08-08T00:00:00Z
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
|
|
|
|||
Loading…
Reference in a new issue