django / djangoproject.com

Source code to djangoproject.com
https://www.djangoproject.com/
BSD 3-Clause "New" or "Revised" License
1.87k stars 947 forks source link

Ability to use images in site content #1501

Open thibaudcolas opened 6 months ago

thibaudcolas commented 6 months ago

Part of recommendations from user research report in #1496

Specifically:

Enhancing Media Presence in the News Section to Leverage Visual Potential and Share Collected Images

Posts like Welcome our new Fellow - Sarah Boyce or DSF Board 2024 Elections – New board members 👋 would really benefit from imagery.

jacklinke commented 4 days ago

From discussions yesterday, it looks like the input for content currently allows either ReStructured Text (RST) or raw html with tags and all.

The only option for including images at this time is to link to an image hosted externally, which then introduces the risk that the external source may disappear, causing broken images in Django Project's content.

Some potential solutions are to use a new field. In any of these cases, a model change & migration, template changes, and a data migration from the current text (and html tag) content would be required, but the end result should be that content is much easier to customize, and images can be hosted on DjangoProject's infrastructure, rather than relying on external resources.

Use a StreamField, content editor, or similar

These offer some of the capabilities of Wagtail's StreamField in a lighter-weight package. Blocks of rich text and images can be included in the page.

django-streamfield

django-content-editor

Use a Markdown field

django-markdownx

The most feature-complete and updated package for markdown editing that also includes image uploads that integrate with django. I have used this package, and it is easy to set up and use.


Is there an appetite for including a new dependency like one of the fields mentioned above?