Skip to content

Commit ea04a73

Browse files
authored
Merge pull request #6 from SubhenduX/main
Replaced Netlify CMS
2 parents 000ae69 + 02b3f0f commit ea04a73

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
# netlify-cms-cloudflare-pages
1+
# Decap-cms-cloudflare-pages
22

3-
[Netlify CMS](https://www.netlifycms.org) needs to authenticate to Github with OAuth. Github needs a server to talk to during the authentication process. If you’re hosting at Netlify, they take care of that. If not, you’re on your own, and the documentation is... imperfect. 😂
3+
[Decap CMS](https://www.decapcms.org) needs to authenticate to Github with OAuth. Github needs a server to talk to during the authentication process. If you’re hosting at Netlify, they take care of that. If not, you’re on your own, and the documentation is... imperfect. 😂
44

55
If you’re deploying to [Cloudflare Pages](https://pages.cloudflare.com) this may be the code you’re looking for. It provides API endpoints for Github to talk to, running on Cloudflare Functions. Functions are kind of like Cloudflare Workers, but they run right from your Pages site.
66

7-
This is based on [d3v1an7/netlify-cms-oauth-cloudflare](https://github.com/d3v1an7/netlify-cms-oauth-cloudflare) adapted for Cloudflare Functions.
7+
## Credits
8+
This is based on [i40west/netlify-cms-cloudflare-pages](https://github.com/i40west/netlify-cms-cloudflare-pages) and [d3v1an7/netlify-cms-oauth-cloudflare](https://github.com/d3v1an7/netlify-cms-oauth-cloudflare) adapted for Cloudflare Functions.
9+
I just Modified it [https://indexedev.com](https://indexedev.com)
810

911
## Installation
1012

1113
### 1. Create OAuth application at Github
1214

13-
Go to Settings -> Developer Settings and choose [OAuth Apps](https://github.com/settings/developers). Create a new OAuth App. Name it anything you like. **Homepage URL** should be set to your site’s URL. **Authorization callback URL** is the important part; it, too, can be set to your homepage URL (like `https://example.com`). Other guides say to set this to the callback API endpoint, but the documented requirement is that the callback URL be a subdirectory of this URL, and using the callback URL itself didn’t work for me.
15+
Go to Settings -> Developer Settings and choose [OAuth Apps](https://github.com/settings/developers). Create a new OAuth App. Name it anything you like. **Homepage URL** should be set to your site’s URL. **Authorization callback URL** is the important part; it, too, can be set to your homepage URL (like `https://indexedev.com`). Other guides say to set this to the callback API endpoint, but the documented requirement is that the callback URL be a subdirectory of this URL, and using the callback URL itself didn’t work for me.
1416

1517
Github will give you a **Client ID**, and you can generate a **Client Secret** at this time. You will need both.
1618

@@ -22,14 +24,12 @@ In your Cloudflare Pages project, go to Settings -> Environment variables. Add t
2224

2325
Take the `functions` directory from this repo and add it to your project at the top level. **NOTE:** This means the actual top-level of the project itself, _not_ the top level of your output directory. So, if you’re using Hugo, `functions` goes at the top of the project next to `content` and `layouts` and `archetypes` and so forth, _not_ inside the `static` or `assets` directory.
2426

25-
If you haven’t already installed the Netlify CMS files, take the `static/admin` directory from this repo and add it to your `static` directory (for Hugo) or wherever you add files to be deployed as-is to your site. There are two files under `admin`, a stub HTML file that loads the CMS, and the CMS config file `config.yml`. You can change the name of the `admin` directory.
27+
If you haven’t already installed the Decap CMS files, take the `static/admin` directory from this repo and add it to your `static` directory (for Hugo) or wherever you add files to be deployed as-is to your site. There are two files under `admin`, a stub HTML file that loads the CMS, and the CMS config file `config.yml`. You can change the name of the `admin` directory.
2628

27-
The config file included here is a starter file only; you need to set this up for your site, which is beyond the scope of these instructions. However, you must set `base_url` in this config to the URL of your site (like `https://example.com`). Setting `auth_endpoint` here is optional because the default path works for the way this repo is set up.
29+
The config file included here is a starter file only; you need to set this up for your site, which is beyond the scope of these instructions. However, you must set `base_url` in this config to the URL of your site (like `https://indexedev.com`). Setting `auth_endpoint` here is optional because the default path works for the way this repo is set up.
2830

2931
### 4. Profit!
3032

3133
Publish your site and let Cloudflare build it. Go to `/admin/` on your site, and you should see a Login with Github button, which should authenticate you to Github and launch the CMS.
3234

33-
## Credits
3435

35-
I've included a dark-mode CSS file from [Nats-ji/netlify-cms-dark-mode](https://github.com/Nats-ji/netlify-cms-dark-mode).

static/admin/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<body>
99
<!-- Include the script that builds the page and powers Netlify CMS -->
1010
<link rel="stylesheet" href="/admin/dark.css">
11-
<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
11+
<script src="https://unpkg.com/decap-cms@3.1.0-beta.5/dist/decap-cms.js"></script>
1212
</body>
1313
</html>

0 commit comments

Comments
 (0)