Idea preview post leave#111
Draft
interim17 wants to merge 2 commits into
Draft
Conversation
… for preview rendering in the idea post template
✅ Deploy Preview for project-idea-board ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Closes #87 Closes #55
Solution
Where before we had no working custom preview for ideas, we have a much improved preview with relevant styling, and a few workarounds that need improvement over time.
What we did:
cms.jshad a type ("idea" vs "ideas") so old preview component wasn't registering at all.Once registered, and refactored to typescript (like the resources example) we hit a few errors. Errors were primarily of two types:
idea-post.tsxtemplate renders children that rely on static Gatsby queries that won't work in the Decap preview. In the template componentisPreviewchecks whether we are in the production site or the CMS, and guards against rendering these ( and ).