This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
fix: unpublish preview for Multi-language #150
Merged
arnaudlewis
merged 11 commits into
birkir:master
from
Duaner:fix-multilanguage-preview-unpublish
Apr 27, 2020
Merged
fix: unpublish preview for Multi-language #150
arnaudlewis
merged 11 commits into
birkir:master
from
Duaner:fix-multilanguage-preview-unpublish
Apr 27, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arnaudlewis
suggested changes
Mar 3, 2020
packages/gatsby-source-prismic-graphql/src/components/WrapPage.tsx
Outdated
Show resolved
Hide resolved
packages/gatsby-source-prismic-graphql/src/utils/parseQueryString.ts
Outdated
Show resolved
Hide resolved
Looking forward to this one getting merged. |
I just realized that there is still a problem there. When you use default lang, the URL for the preview page is properly set but doesn't load properly the preview component but the 404 page. I will see what i can do for this next week. |
@Duaner Did you make any progress on this? :) |
@veloce a Prettier check fails on your last commit |
For anyone who needs a fix before this gets merged, just hardcode urls for each langauge in
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When building the preview page for a specific Custom type, a lang is set statically in the context and not properly replaced by the one passed through the URL Path or QueryString.
Fixes #86
Description
We now use only queryString for unpublished documents since we had conflict in the router. In development, if you were using the DefaultLang option and tried to preview an unpublish doc, the 404 was always showing. We bypassed that by using queryString for all unpublished docs. If the doc is already published we redirect to a pretty URL.
Added a new utils to get QueryString as JSON
Bug fixes
Breaking changes
path
is no longer used ingatsby-config.js
; you should usematch
to define your pages path ; and you can usepreviewPath
if you want to change the default route for unpublished document preview pageI also updated to the newest toolbar that should Fix #126