mirror of
https://github.com/danbee/danbarber.me
synced 2025-03-04 08:59:10 +00:00
Add Netlify CMS
This commit is contained in:
parent
d7700a805d
commit
4c31f3cbf0
@ -16,4 +16,16 @@
|
||||
</p>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
if (window.netlifyIdentity) {
|
||||
window.netlifyIdentity.on("init", user => {
|
||||
if (!user) {
|
||||
window.netlifyIdentity.on("login", () => {
|
||||
document.location.href = "/admin/";
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
{% include analytics.html %}
|
||||
|
||||
@ -47,3 +47,5 @@
|
||||
<meta property="og:description" content="{% if page.excerpt != nil %}{{ page.excerpt | strip_html | truncatewords:50 }}{% else %}{{ site.description }}{% endif %}">
|
||||
<meta property="og:locale" content="en_UK">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
|
||||
|
||||
20
admin/config.yml
Normal file
20
admin/config.yml
Normal file
@ -0,0 +1,20 @@
|
||||
backend:
|
||||
name: git-gateway
|
||||
branch: master
|
||||
|
||||
publish_mode: editorial_workflow
|
||||
|
||||
media_folder: "_pictures/blog"
|
||||
|
||||
collections:
|
||||
- name: "blog"
|
||||
label: "Blog"
|
||||
folder: "_posts"
|
||||
create: true
|
||||
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
|
||||
fields:
|
||||
- { label: "Layout", name: "layout", widget: "hidden", default: "post" }
|
||||
- { label: "Title", name: "title", widget: "string" }
|
||||
- { label: "Publish Date", name: "date", widget: "datetime" }
|
||||
- { label: "Categories", name: "categories", widget: "list" }
|
||||
- { label: "Body", name: "body", widget: "markdown" }
|
||||
16
admin/index.html
Normal file
16
admin/index.html
Normal file
@ -0,0 +1,16 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<title>Content Manager</title>
|
||||
|
||||
<link rel="stylesheet" href="https://unpkg.com/netlify-cms@^1.0.0/dist/cms.css" />
|
||||
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script src="https://unpkg.com/netlify-cms@^1.0.0/dist/cms.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user