Home
Support Forums

How to use Netlify CMS for any site on local development

I want to setup Netlify CMS for my site on my local system without using https://app.netlify.com as I will deploy the site on my own but I want to manage my site locally using Netlify CMS.
So please let me know how to do that.

Check out this feature:

https://www.netlifycms.org/docs/beta-features/#working-with-a-local-git-repository

Be aware though: You’ll still need a static site generator, as Netlify CMS can’t edit html directly.

1 Like

Thanks for your reply. On local it is done with proxy it directs logins into cms. But if I want to do authentication in Netlify CMS how can we do?
Also from local with use of Netlify CMS can I use the Git repository so that it directs changes code there?

You’ll have to set up your own authentication:
https://www.netlifycms.org/docs/external-oauth-clients/

There’s a pretty good article about it which you can find here:

Thanks for your reply.
I have one image in div tag in html what to mention in config.yml file to update this through Netlify CMS?

You can’t edit html tags directly. You’ll have to use a static site generator instead.

I have done image edit using json
Now the problem is in config.yml I have defined

- label: "Page3"
        name: "page3"
        file: "page3.json"
        fields:
          - label: "Title"
            name: "title"
            widget: "string"
          - label: "Description"
            name: "description"
            widget: "string"
          - label: "Image"
            name: "image"
            widget: "image"
            choose_url: true
            media_library:
             config:
              multiple: true
media_folder: image

So image is my folder for upload images.
Now problem is in json file in image key it is updated like this

“image”: “/image/client_logo_14.jpg”

I dont want the image folder in this or the first slash /

i want like this

“image”: “image/client_logo_14.jpg”
or
“image”: “client_logo_14.jpg”

so for this what can I do?

Can you share the full contents of your config.yml?

Find below full contents of config.yml file.

backend:
  name: git-gateway
local_backend: true
collections:
  - name: "pages"
    label: "Pages"
    extension: "json"
    files:
      - label: "Page1"
        name: "page1"
        file: "people.json"
        fields:
          - label: "Person"
            name: "person"
            widget: "list"
            fields:
              - {label: "FirstName", name: "firstName", widget: "string"}
              - {label: "LastName", name: "lastName", widget: "string"}
              - {label: "Email", name: "email", widget: "string"}
              - {label: "City", name: "city", widget: "string"}
      - label: "Page2"
        name: "page2"
        file: "employee.json"
        fields:
          - label: "Employee"
            name: "employee"
            widget: "list"
            fields:
              - {label: "Employee Code", name: "empcode", widget: "string"}
              - {label: "Employee Name", name: "empname", widget: "string"}
              - {label: "Designation", name: "empdeg", widget: "string"}
              
      - label: "Page3"
        name: "page3"
        file: "page3.json"
        fields:
          - label: "Title"
            name: "title"
            widget: "string"
          - label: "Description"
            name: "description"
            widget: "string"
          - label: "Image"
            name: "image"
            widget: "image"
            choose_url: true
            media_library:
             config:
              multiple: true
media_folder: image

Have you seen the above config.yml file please let me know about my image query.

It’s morning here and I’m quite busy, I’ll take a look later today.

ok no problem but please provide the solution when you become free. Thanks in advance.

Depending on your SSG’s language, you could probably simply trim the slash. For example, if you’re using JavaScript, you could do like fields.image.slice(1). It would remove the / from the value.

Yes that I can do but if it directly store without slash or direct filename then it will be good so I have asked this

In that case, I believe public_folder might help:

https://www.netlifycms.org/docs/configuration-options/#public-folder

Thank You Sir through public_folder the image name has stored directly in json.
Now I have one scenario

I want to use Netlify CMS for my site which is not using github or gitgateway. It is deployed in AWS cloud.
Now using Netlify CMS I want to change the site but in Netlify CMS I dont want any user can do it by enabling local proxy using this

npx netlify-cms-proxy-server

I want to authenticate so that some user only can access the Netlify CMS.

Please suggest what can I do to achieve this.

I’m confused. Doesn’t removing the local_backend option fix the problem?

Removing the local_backend option it shows this page now in this which email and password is used to login?

Please reply to my above query.

That depends on how you’ve setup Netlify CMS. By default, you’d need to use Netlify Identity. If you don’t want to use that, you would have to take a look at:

https://www.netlifycms.org/docs/git-gateway-backend/#git-gateway-without-netlify

OR

https://www.netlifycms.org/docs/external-oauth-clients/