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

Clean up content model #27

Merged
merged 65 commits into from
Jul 29, 2022
Merged

Clean up content model #27

merged 65 commits into from
Jul 29, 2022

Conversation

peterschewe
Copy link
Contributor

@peterschewe peterschewe commented Jul 4, 2022

Fixes #23

  • Merge page and t-default into t-page
  • Rename seo to d-seo
  • Rename name fields to internal_name
  • Add help text for internal_name fields
  • Make internal_name fields required
  • Remove content type section
  • Limit the entries in m-columns (each column max. 1)
  • Bump cssg packages to latest versions (especially contentful-migrations with the new field grouping feat.)
  • Remove t-default Storybook example (open issue: page templates cannot be created in Storybook)
  • Disable lazy load option of c-image and m-media for editors
  • Update t-page migration and use field grouping (Compose only) to separate page and seo settings
  • Disable theming option of t-page and all modules for editors
  • Align naming of headlines with ui/ux (e.g. headline instead of title)
  • Use HUGO_ENV instead of HUGO_ENVIRONMENT
  • Remove the ability to change the logo via Contentful
  • Disable theme option of t-page
  • Disable hero content in m-stage
  • Rename m-editorial to m-hero

@peterschewe peterschewe linked an issue Jul 4, 2022 that may be closed by this pull request
@peterschewe peterschewe marked this pull request as ready for review July 5, 2022 08:07
@peterschewe peterschewe marked this pull request as draft July 6, 2022 14:00
@peterschewe peterschewe marked this pull request as ready for review July 6, 2022 14:00
@@ -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-")) }}
Copy link
Contributor Author

@peterschewe peterschewe Jul 28, 2022

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.

Copy link
Contributor Author

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.
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
11.4% 11.4% Duplication

@peterschewe peterschewe merged commit 19b3d3a into main Jul 29, 2022
@peterschewe peterschewe deleted the feature/23-clean-up-content-model branch July 29, 2022 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up content model
2 participants