Note: this plugin works, but I have made a better and easier to use plugin that does the same thing. You can find it here GitHub - scossar/discourse-grid: A basic grid system for Discourse posts
Continuing the discussion from Image Alignment:
Here’s my first attempt at making a plugin for adding css classes to the post markup in order to control its layout. GitHub - scossar/post-styles: user configurable post styles for Discourse
It whitelists a group of classes that are then used to set the width on
div elements in the post. It wraps uploaded images in
figure tags. The whitelisted classes are mainly intended to be applied to the
figure tags, but for more advanced layouts they can be applied to
div tags that are added to the post.
It lets you do things like this:
At this point, for mobile devices the classes are all set to display at
width: 100%; height: auto.
If you are going to use this in a production environment, make sure you really test it out first! I have a use for this plugin, so I’ll keep working at it.