-
Notifications
You must be signed in to change notification settings - Fork 4
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
Clean up content model #27
Conversation
packages/contentful-migrations/core/0000000000006-configure-x-deploy-migration.js
Outdated
Show resolved
Hide resolved
…m/jungvonmatt/wekit into feature/23-clean-up-content-model
@@ -14,7 +14,7 @@ | |||
{{ $content_type := .content_type }} | |||
{{ $params := dict }} | |||
|
|||
{{ if (eq $content_type "page") }} | |||
{{ if (or (eq $content_type "page") (hasPrefix $content_type "t-")) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bezoerb, there is still a breaking change here that we need to resolve. If the content type is t-default
(legacy), then it tries to get the .Params
directly, as it would be correct for t-page
. But they are in data
and would have to be fetched via utils/get-data
. With the hasPrefix $content_type "t-"
we take t-page
and t-default
in the same way, which was fine in other places, but not here.
Can we differ the legacy templates (data/
) from the new ones (content/
) at this point? Or do you have another idea?
Maybe just check if this file exists in data and only then use utils/get-data
. Then we could omit the check for the content_type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have completely removed the check on page type. Instead I try to get page params directly and if they are empty I use get-data.
Get page and data in a backward compatible way.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Fixes #23
page
andt-default
intot-page
seo
tod-seo
name
fields tointernal_name
internal_name
fieldsinternal_name
fields requiredsection
m-columns
(each column max. 1)t-default
Storybook example (open issue: page templates cannot be created in Storybook)c-image
andm-media
for editorst-page
migration and use field grouping (Compose only) to separate page and seo settingst-page
and all modules for editorsHUGO_ENV
instead ofHUGO_ENVIRONMENT
t-page
m-stage
m-editorial
tom-hero