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

Preview tokens 6a: Fix preview token of the site model #6828

Open
wants to merge 1 commit into
base: v5/changes/preview-tokens-6
Choose a base branch
from

Conversation

lukasbestle
Copy link
Member

🚨 Merge first

Description

Summary of changes

In PR 3 I introduced the new $version->previewToken() method. While writing tests for PR 7 I realized that giving the site model its own preview token was wrong. The site preview renders the home page by default, so it also needs to use the home page's preview token by default.

Additional context

This is an "intermediary" PR that gets its name 6a so that we can continue with PR 7 with its original intended contents I already announced.

Changelog

None (internal change before any release)

Docs

None

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and CI checks all pass

For review team

  • Add lab and/or sandbox examples (wherever helpful)
  • Add changes & docs to release notes draft in Notion

Site does not have a preview by itself, so Kirby will render the homepage and check its token instead.
@lukasbestle lukasbestle added the type: bug 🐛 Is a bug; fixes a bug label Dec 2, 2024
@lukasbestle lukasbestle added this to the 5.0.0-beta.1 milestone Dec 2, 2024
@lukasbestle lukasbestle self-assigned this Dec 2, 2024
Copy link
Member

@bastianallgeier bastianallgeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: What happens when the site or a page sets a completely different preview URL in its blueprint? Does this matter here at all?

@lukasbestle
Copy link
Member Author

Very good question. But also simple to answer:

Those custom blueprint-defined previews will follow in the last PR 9 and will be implemented by constructing the token from the raw URI. Model-based tokens will still be relevant for the default case as they are more robust and reliable if no URI-based token is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants