decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.66k stars 3.02k forks source link

I keep getting redirect to deployed website when i try to access http://localhost:5173/admin/index.html #7067

Closed teotimepacreau closed 5 months ago

teotimepacreau commented 5 months ago

Describe the bug When I try to access the local admin page (http://localhost:5173/admin/index.html) it redirects me everytime to the deployed Netlify page, so I can't make any changes locally

Expected behavior When going to the localhost admin/index.html page, accessin to the local DECAP admin panel and allow to add posts locally

Screenshots

https://github.com/decaporg/decap-cms/assets/95431443/f86b5167-bf67-495d-b2bd-944494210e53

Applicable Versions:

CMS configuration config.yml : backend: name: git-gateway repo: teotimepacreau/Mairies-Sveltekit branch: decap # Branch to update (optional; defaults to master)

This line should not be indented

publish_mode: editorial_workflow

These lines should not be indented

media_folder: "static/uploads" # Media files will be stored in the repo under static/uploads public_folder: "/uploads" # The src attribute for uploaded media will begin with /uploads

collections:

martinjagodic commented 5 months ago

@teotimepacreau does this happen on decap v3 also?

teotimepacreau commented 5 months ago

@martinjagodic

Yes, I just tried with Decap v3 (installed through npm) and doing exactly the same problem no matter what I change in the config.yml. See my repo branch with Decap V3 in use

package.json : "dependencies": { "decap-cms": "^3.0.12" }

https://github.com/decaporg/decap-cms/assets/95431443/0dc72c9c-c1a4-4d24-8f64-50b4fd3c9415

martinjagodic commented 5 months ago

I see. You need to run the local server, not login with GitHub. See here: https://decapcms.org/docs/working-with-a-local-git-repository/

teotimepacreau commented 5 months ago

now working thanks a lot ! for Docs enhancement purpose, please add that "Run npx decap-server must be run in parallel with the local development server of the app (typically npm run dev)" in https://decapcms.org/docs/working-with-a-local-git-repository/. Because doc is really unclear.

Please consider doing a beginner friendly tuto vid with the 2 approaches you are developping in your presentation vid (localhost and netlify deployed) Unleashing the Power of Git-Based Content Management Systems - Martin Jagodic (Decap CMS), because it makes believe that localhost and deployed DECAP admin page are available by default without modifying the config each time to switch between the two