Repository navigation
New Feature: add structured data - #20
Merged
Merged
Conversation
1letter
commented
Oct 7, 2026
Contributor
- register a new viewlet
- extend the behavior with new field to provide structured data
- implement an adapter resolution to provide structured data in an alternative way (similar to CSS body classes in plone.app.layout)
erral
self-requested a review
October 7, 2026 12:25
petschki
requested changes
Oct 7, 2026
petschki
left a comment
Member
There was a problem hiding this comment.
I had a quick look at this. See my comments.
petschki
approved these changes
Oct 8, 2026
petschki
left a comment
Member
There was a problem hiding this comment.
In general LGTM!
My comments are more cosmetic ...
|
|
||
| try: | ||
| extra_data = seo_adapter.get_data() or [] | ||
| except (TypeError, KeyError, AttributeError): |
Member
There was a problem hiding this comment.
I'd put a log here, to show which adapter has problems. Also what about ValueError ? Maybe catch all exceptions?
| class StructuredDataViewlet(ViewletBase): | ||
| """Base viewlet to render content metadata as JSON-LD""" | ||
|
|
||
| """ the use of this decorator is this a right approach?""" |
Member
|
@petschki was indeed faster than me checking this, but I really like the adapter way to append data to the structured data record, I wonder we could do the same for social tags (right now we have to inherit the viewlet and override a method) Big +1 |
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.