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

Add shortcodes for image placement #85

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

gmantele
Copy link
Member

@gmantele gmantele commented Sep 30, 2024

This PullRequest adds two shortcodes in order to help placing images in a page:

  • floating.html: it is just applying the CSS style float: left/right on a given content. This content can be an image but also anything else. It may take one (un-named) parameter: left (default) or right

    Usage example:

    {{< floating right >}}                                                           
    ![](ivoa_logoc2.jpg)                                                             
    {{</ floating >}}
    
  • side-image: this shortcode is entirely dedicated to images.

    It takes at least one parameter, the URL of the side image: image.

    It also accepts another parameter to give the URL of a thumbnail of the image: thumbnail. With this additional parameter, the image becomes clickable ; the click leads to the full size image.

    A third parameter lets specify whether the side image should be on the left or on the right: position. If unspecified, it will be on the left.

    The body content of this shortcode, is the content (text or not) to be placed on right or the left of the image.

    Usage example:

    {{< side-image image="my-image.png" thumbnail="my-image_thumb.png" >}}
    **Super** blabla
    {{</ side-image >}}
    

    This shortcode could be improved by adding a target URL. Then, the click would not lead to the full size image but to the given URL. The full size image could then be displayed on mouse hover or with a small magnifier button appearing over the image. Similarly, it could be possible to do the same with a figure (then, with a numbered caption) instead of a simple image. All these improvements (and maybe others) can be made later when needed.

Fixes #84

This shortcode is a bit different from the `floating` shortcode. The content
is not floating around the image, but is rather visually put on a separate
column.
@gmantele gmantele added the new feature New feature or request label Sep 30, 2024
@gmantele gmantele self-assigned this Sep 30, 2024
@molinaro-m
Copy link
Member

@JeremyMcCormick @gmantele is this safe to merge? I'd like to try it for member organizations page and I'm wondering how to proceed

@gmantele
Copy link
Member Author

gmantele commented Oct 1, 2024

It works fine with newsletters on my local preview but also on our test website:

Copy link
Member

@molinaro-m molinaro-m left a comment

Choose a reason for hiding this comment

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

I'd say we can approve this (for me it works).
Feel free to merge it, so we can build other pages on top of this.

@JeremyMcCormick
Copy link
Collaborator

Thanks for these!

Going to merge

@JeremyMcCormick JeremyMcCormick merged commit a594cf0 into main Oct 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add short codes for image placement and manipulation
3 participants