leactz
leactz

Reputation: 63

Decap + Netlify - Deploy Preview Links Not Working

I am deploying through Netlify.

Deploy preview links are only ever directed to the live, published site. According to Decap's deploy preview docs, it should work automatically with my setup and CMS version. When I enable editorial workflow, save changes from the CMS and check for preview on a specific entry, I do see the 'View Preview' link. However, this does not direct me to deploy-preview-20--example.com as would be expected, but simply to example.com. I tried using the original netlify-assigned url instead of my custom domain in the site_url entry for the config, and the same happens. I have tried using Git Gateway instead of Gitlab with oauth, and the same happens. What am i missing to pass the real generated URL for the deploy preview back to Decap?

In my repo, I can see that there is a new branch created for the commit after saving an edit. I can also go into the 'Deploys' section of my Netlify UI. If I open the deploy preview from there, I see the saved changes reflected in the content. So everything seems to be working, barring the fact that my 'View Deploy' button in my CMS UI is not linked to the actual preview url.

Here are the relevant parts of my Decap config, using example URLs and sections:

backend:
  name: gitlab
  repo: repo-owner/reponame
  app_id: # app-id-here
  auth_type: pkce
  branch: main # Branch to update (optional; defaults to master)s

media_folder: 'static/images/'
public_folder: '/images/'
publish_mode: editorial_workflow
display_url: "https://example.com/"
site_url: "https://example.com/"

collections:
  - label: "Homepage"
    name: "home"
    files:
      - label: "Hero Section"
        name: "intro"
        file: path/to/file.md
        preview_path: "/"
        fields:
          # some fields here
   - label: "Contact Page"
     name: "contact"
     preview_path: "contact-us"
     files:
       - label: 'Intro'
          name: intro
          file: path/to/file.md
          fields:
              # some fields here

I know there was a similar question up, but it had no replies, and I'm really hoping for some advice.

Upvotes: 2

Views: 260

Answers (0)

Related Questions