newbthenewbd / grav-plugin-tinymce-editor

TinyMCE Editor Integration Plugin for Grav
Other
60 stars 10 forks source link

Images URL aren't dynamic #35

Closed Heraes-git closed 3 years ago

Heraes-git commented 5 years ago

When developing a website, we sometimes have to fill the pages with content and images.

Actually, the TinyMCE image feature (the manager opening in popup) forces the developer or user to type the entire path to the media, including the host URL.

But doing this, the HTML generated code will not be dynamic, and when moving the website to the production environment, or when migrating from a prod site to an other, all the images (and possibly <a>links) URLs will have to be rewritten.

Solution

TinyMCE should convert URL in TWIG (and use {{ base_url }}{{ page.url }}/ as a prefix), or apply a basic markdown syntax (see my Markdown mode request).

newbthenewbd commented 5 years ago

The soon-to-be release of the plugin is planned to deprecate the semi-absolute path handling in favor of fully relative paths, akin to these that Grav feeds Markdown with; I have recently pushed a new development version to the develop branch with the new path handling implemented.

The latest development version of the plugin can be installed as explained here. If it's not a problem, I'd love to receive some feedback if it works... And if it doesn't work, especially so! :smile:

Thanks!

newbthenewbd commented 3 years ago

(Finally) implemented in v1.3.0 - hopefully it's going to work as good as it did in my tests, if it does not, please notify. :slightly_smiling_face: