Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
teotimepacreau opened this issue Jan 28, 2024 · 4 comments

Comments

@teotimepacreau
Copy link

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

2024-01-28.12-19-01.mp4

Applicable Versions:

  • Decap CMS version: 2.10.192
  • Git provider: GitHub
  • OS: Windows 11
  • Browser version : Chrome 120.0
  • Node.JS version: v18.17.0

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:

  • name: "articles" # Used in routes, e.g., /admin/collections/blog
    label: "Articles" # Used in the UI
    folder: "src/articles" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    slug: "{{slug}}" # Filename template, e.g., title.md
    fields:
    • { label: "Layout", name: "layout", widget: "hidden", default: "blog" }
    • { label: "Title", name: "title", widget: "string" }
    • { label: "Description", name: "description", widget: "string" }
    • { label: "Publish Date", name: "date", widget: "datetime" }
    • { label: "Featured Photo", name: "featured", widget: "image", required: false }
    • { label: "Body", name: "body", widget: "markdown" }
@teotimepacreau teotimepacreau added the type: bug code to address defects in shipped code label Jan 28, 2024
@martinjagodic
Copy link
Member

@teotimepacreau does this happen on decap v3 also?

@martinjagodic martinjagodic added status: more info needed and removed type: bug code to address defects in shipped code labels Jan 30, 2024
@teotimepacreau
Copy link
Author

teotimepacreau commented Jan 30, 2024

@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"
}

2024-01-30.14-53-26.mp4

@martinjagodic
Copy link
Member

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
Copy link
Author

teotimepacreau commented Jan 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants