Skip to content

Commit fafa5a1

Browse files
authored
Update Docs: migrate Beta Features - Local Git Repository (#7043)
* Update Docs: Configuration “beta-features” * Create Docs: Account “working-with-a-local-git-repository”
1 parent 6a45d3b commit fafa5a1

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

website/content/docs/beta-features.md

+1-47
Original file line numberDiff line numberDiff line change
@@ -7,51 +7,6 @@ We run new functionality in an open beta format from time to time. That means th
77

88
**Use these features at your own risk.**
99

10-
## Working with a Local Git Repository
11-
12-
13-
14-
You can connect Decap CMS to a local Git repository, instead of working with a live repo.
15-
16-
1. Navigate to a local Git repository configured with the CMS.
17-
2. Add the top-level property `local_backend` configuration to your `config.yml`:
18-
19-
```yaml
20-
# when using the default proxy server port
21-
local_backend: true
22-
23-
backend:
24-
name: git-gateway
25-
```
26-
27-
3. Run `npx decap-server` from the root directory of the above repository.
28-
29-
* If the default port (8081) is in use, the proxy server won't start and you will see an error message. In this case, follow [these steps](#configure-the-decap-server-port-number) before proceeding.
30-
4. Start your local development server (e.g. run `gatsby develop`).
31-
5. Open `http://localhost:<port>/admin` to verify that your can administer your content locally. Replace `<port>` with the port of your local development server. For example Gatsby's default port is `8000`
32-
33-
**Note:** `decap-server` runs an unauthenticated express server. As any client can send requests to the server, it should only be used for local development. Also note that `editorial_workflow` is not supported in this environment.
34-
35-
### Configure the Decap CMS proxy server port number
36-
37-
1. Create a `.env` file in the project's root folder and define the PORT you'd like the proxy server to use
38-
39-
```ini
40-
PORT=8082
41-
```
42-
43-
2. Update the `local_backend` object in `config.yml` and specify a `url` property to use your custom port number
44-
45-
```yaml
46-
backend:
47-
name: git-gateway
48-
49-
local_backend:
50-
# when using a custom proxy server port
51-
url: http://localhost:8082/api/v1
52-
# when accessing the local site from a host other than 'localhost' or '127.0.0.1'
53-
allowed_hosts: ['192.168.0.1']
54-
```
5510

5611
## GitLab and BitBucket Editorial Workflow Support
5712

@@ -709,5 +664,4 @@ CMS.registerCustomFormat('yml', 'yml', {
709664
fromFile: text => jsYaml.load(text),
710665
toFile: value => jsYaml.dump(value),
711666
});
712-
```
713-
667+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
group: Accounts
3+
weight: 70
4+
title: Working with a Local Git Repository
5+
---
6+
You can connect Decap CMS to a local Git repository, instead of working with a live repo.
7+
8+
1. Navigate to a local Git repository configured with the CMS.
9+
2. Add the top-level property `local_backend` configuration to your `config.yml`:
10+
11+
```yaml
12+
# when using the default proxy server port
13+
local_backend: true
14+
15+
backend:
16+
name: git-gateway
17+
```
18+
19+
3. Run `npx decap-server` from the root directory of the above repository.
20+
21+
* If the default port (8081) is in use, the proxy server won't start and you will see an error message. In this case, follow [these steps](#configure-the-decap-server-port-number) before proceeding.
22+
4. Start your local development server (e.g. run `gatsby develop`).
23+
5. Open `http://localhost:<port>/admin` to verify that your can administer your content locally. Replace `<port>` with the port of your local development server. For example Gatsby's default port is `8000`
24+
25+
**Note:** `decap-server` runs an unauthenticated express server. As any client can send requests to the server, it should only be used for local development. Also note that `editorial_workflow` is not supported in this environment.
26+
27+
### Configure the Decap CMS proxy server port number
28+
29+
1. Create a `.env` file in the project's root folder and define the PORT you'd like the proxy server to use
30+
31+
```ini
32+
PORT=8082
33+
```
34+
35+
2. Update the `local_backend` object in `config.yml` and specify a `url` property to use your custom port number
36+
37+
```yaml
38+
backend:
39+
name: git-gateway
40+
41+
local_backend:
42+
# when using a custom proxy server port
43+
url: http://localhost:8082/api/v1
44+
# when accessing the local site from a host other than 'localhost' or '127.0.0.1'
45+
allowed_hosts: ['192.168.0.1']
46+
```

0 commit comments

Comments
 (0)