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

images.Text: Add option for vertical alignment #13415

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pranshugaba
Copy link

@pranshugaba pranshugaba commented Feb 18, 2025

Add option aligny to specify the vertical alignment of the text with respect to the y offset from the top of the image. Possible values of aligny are top (default), center, and bottom.

The height of the block of text is measured from the top of the first line to the baseline of the last line.

  • top: (Current behaviour) The top of the first line of the block of text is at an offset of y from the top of the image.

  • center: The vertical center of the block of text is at an offset of y from the top of the image.

  • bottom: The baseline of the last line of the text is at an offset of y from the top of the image.

Resolves #13414

Examples:

  • Vertically center-aligned text with aligny set to center
    center-1
    center-2
    center-3
  • Title is bottom-aligned and subtitle is top-aligned
    bottom-1
    bottom-2

Add option ``aligny`` to specify the vertical alignment of the text
with respect to the ``y`` offset from the top of the image. Possible
values of ``aligny`` are ``top`` (default), ``center``, and ``bottom``.

The height of the block of text is measured from the top of the first
line to the baseline of the last line.

- ``top``: (Current behaviour) The top of the first line of the block of
  text is at an offset of ``y`` from the top of the image.

- ``center``: The vertical center of the block of text is at an offset of
  ``y`` from the top of the image.

- ``bottom``: The baseline of the last line of the text is at an offset
  of ``y`` from the top of the image.

Resolves gohugoio#13414
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

images.Text: Add support for vertical alignment of text
1 participant