Skip to content

Commit 94be2c1

Browse files
authored
Merge pull request #1 from indigotree/cms
Added Netlify CMS
2 parents 8f681fb + 53ddc26 commit 94be2c1

File tree

5 files changed

+64
-1
lines changed

5 files changed

+64
-1
lines changed

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,28 @@ This is a Netlify feature. Learn more about [Netlify Redirects](https://www.netl
5858

5959
Hugo [Aliases](https://gohugo.io/content-management/urls/#aliases) are usually handled by `<meta http-equiv="refresh" ...>` tags. These have been disabled within `config.toml` with `disableAliases = true`, and instead are handled by [Netlify Redirects](https://www.netlify.com/docs/redirects/). This is handled automatically and you should continue to add aliases as described in the Hugo documentation.
6060

61+
## Netlify CMS
62+
63+
Atlas provides a copy of [Netlify CMS](https://www.netlifycms.org/) which is a fantastic CMS for JAMstack sites where everything is managed by GIT.
64+
65+
You will need to configure Netlify CMS to point to your own repo. You can do this within `/static/admin/config.yml` by updating `backend: repo:` with your repository information. Here's an example:
66+
67+
```
68+
backend:
69+
name: github
70+
repo: indigotree/atlas
71+
```
72+
73+
Checkout the [quick start](https://www.netlifycms.org/docs/quick-start/) section on the Netlify CMS docs for more information.
74+
75+
### Remove Netlify CMS
76+
77+
If Netlify CMS isn't your thing, you can remove it with:
78+
79+
```
80+
npm run cms:delete
81+
```
82+
6183
## Deploy to Netlify
6284

6385
You can deploy directly to Netlify using this button:

gulpfile.babel.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict'
22

33
import gulp from 'gulp'
4+
import del from 'del'
45
import runSequence from 'run-sequence'
56
import gulpLoadPlugins from 'gulp-load-plugins'
67
import { spawn } from "child_process";
@@ -98,3 +99,7 @@ gulp.task('images', () => {
9899
.pipe($.imagemin())
99100
.pipe(gulp.dest('static/images'));
100101
});
102+
103+
gulp.task('cms-delete', () => {
104+
return del(['static/admin'], { dot: true })
105+
})

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"scripts": {
55
"build": "gulp build",
66
"build:preview": "gulp build-preview",
7-
"server": "gulp server"
7+
"server": "gulp server",
8+
"cms:delete": "gulp cms-delete"
89
},
910
"dependencies": {
1011
"babel-core": "^6.25.0",

static/admin/config.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
backend:
2+
name: github
3+
repo: repo
4+
branch: master
5+
media_folder: "static/uploads"
6+
public_folder: "/uploads"
7+
collections:
8+
9+
- name: "page"
10+
label: "Page"
11+
folder: "content"
12+
create: true
13+
slug: "{{slug}}"
14+
fields:
15+
- { label: "Title", name: "title", widget: "string" }
16+
- { label: "Publish Date", name: "date", widget: "datetime" }
17+
- { label: "Body", name: "body", widget: "markdown" }

static/admin/index.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
8+
<title>Content Manager</title>
9+
10+
<link rel="stylesheet" href="https://unpkg.com/netlify-cms@~0.4/dist/cms.css" />
11+
12+
</head>
13+
<body>
14+
15+
<script src="https://unpkg.com/netlify-cms@~0.4/dist/cms.js"></script>
16+
17+
</body>
18+
</html>

0 commit comments

Comments
 (0)