Code Monkey home page Code Monkey logo

Comments (5)

setanarut avatar setanarut commented on May 24, 2024 1

Hi @panr Image now centered but the title does not appear because <img> tag does not have the title attribute.

your shortcode input
{{< image src="/img/spot.gif" position="center" title="This is title" >}}

html output
<img src="/img/spot.gif" class="center">

actually it should be this way --> https://www.w3schools.com/tags/tag_figcaption.asp

from hugo-theme-hello-friend.

panr avatar panr commented on May 24, 2024 1

@hazar-e

Ok, now you have figure shortcode with props:

  • src (required)
  • alt (image alt)
  • position (left is default; figure position left | center | right)
  • style (image additional styling)
  • caption (figure caption)
  • captionPosition (center is default; but you can set it to left | center | right)
  • captionStyle (caption additional styling)

from hugo-theme-hello-friend.

panr avatar panr commented on May 24, 2024

Hi @hazar-e πŸ‘‹πŸ» I’ve just added a shortcode {{ < image > }} to help you with this issue. Shortcode has one required prop src just like default html element and few optional: alt (String), position(left | center | right) and style (for any additinal CSS inline styling props).

If you don’t know what shortcodes are, please read Hugo docs
https://gohugo.io/content-management/shortcodes/

from hugo-theme-hello-friend.

panr avatar panr commented on May 24, 2024

Oh, now I see. I made image shortcode, not figure. I'll fix it today ;-)

from hugo-theme-hello-friend.

setanarut avatar setanarut commented on May 24, 2024

@panr thank you for your interest. Good work.

from hugo-theme-hello-friend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.