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

feat: resolve links and embeds in news body #25

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

niccofyren
Copy link
Member

Closes: #19

Tried to get a more complete solution in place, but hit a lot of undocumented(?) or unsupported(?) wagtail parts. Will make a separate draft PR with some of the leftovers too show theory.

What we get in this PR

  • Links in body is resolved to html Wagtail would use in own frontend
  • Embeds (including image embeds) in body is resolved to html Wagtail would use in own frontend

What a future and better version would deliver

  • More sophisticated markup with absolute urls, srcset, etc
  • More granular adjustments on links and other embed types
  • Limited, but frontend supported, image positions/variants
  • ... or alternatively we could deliver data as json array and convert to html on frontend side (I think this is my current favourite since it decouples backend and frontend code more)

Copy link
Member

@mfyll mfyll left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@niccofyren niccofyren merged commit 1f2ba79 into main Oct 8, 2024
5 checks passed
@niccofyren niccofyren deleted the feat/resolve-body-links-and-embeds branch October 8, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Image in article body
2 participants