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

Svg using ![]() rendering without caption and in new line #183

Closed
njelich opened this issue Apr 4, 2021 · 3 comments
Closed

Svg using ![]() rendering without caption and in new line #183

njelich opened this issue Apr 4, 2021 · 3 comments

Comments

@njelich
Copy link

njelich commented Apr 4, 2021

Description

When using for example ![Svg Title](Svg link), the SVG renders in a new line. Expected behavior below achieved using a png generated from SVG.

note: rendering completely breaks with version 2.3.0, so I think the conditional clause for the svg is not correct.

To Reproduce

![The old dragon logo PNG](dragon.png) ![New dragon logo, traced to SVG](dragon.svg)

Expected behavior

Screenshot 2021-04-04 at 13 42 51

Produced result

Screenshot 2021-04-04 at 14 01 37

Environment

  • Hugo version [e.g: 2.2.0]:
  • Hugo extended?: Yes

Content of config.yaml

baseurl: example.com
languageCode: en-us
paginate: 5
title: Title

# Theme i18n support
# Available values: en, fr, id, ja, ko, pt-br, zh-cn
DefaultContentLanguage: en

enableRobotsTXT: true

permalinks:
    post: /p/:slug/
    page: /:slug/

params:
    mainSections:
        - post
    featuredImageField: image
    rssFullContent: true
    favicon: img/favicon.ico

    footer:
        since: 2020
        customText:

    dateFormat:
        published: Jan 02, 2006
        lastUpdated: Jan 02, 2006 15:04 MST

    sidebar:
        subtitle: Just a click away
        avatar:
            local: true
            src: img/avatar.jpg

    article:
        math: true
        license:
            enabled: true
            default: Licensed under CC BY-NC-SA 4.0

    comments:
        enabled: true
        provider: disqus

    widgets:
        enabled:
            - search
            - archives
            - tag-cloud

        archives:
            limit: 5

        tagCloud:
            limit: 10

    opengraph:
            card: summary_large_image

    defaultImage:
        opengraph:
            enabled: false
            local: false
            src:

    colorScheme:
        # Display toggle
        toggle: true

        # Available values: auto, light, dark
        default: auto

    imageProcessing:
        cover:
            enabled: true
        content:
            enabled: true

menu:
    main:
        - identifier: home
          name: Home
          url: /
          weight: -100
          pre: home

        - identifier: about
          name: About
          url: about
          weight: -90
          pre: user

        - identifier: archives
          name: Archives
          url: archives
          weight: -70
          pre: archives

        - identifier: search
          name: Search
          url: search
          weight: -60
          pre: search

related:
    includeNewer: true
    threshold: 60
    toLower: false
    indices:
        - name: tags
          weight: 100

        - name: categories
          weight: 200

markup:
    highlight:
        noClasses: false

Link to repo: https://gitlab.com/njelich/saelbennoa.gitlab.io

@CaiJimmy
Copy link
Owner

CaiJimmy commented Apr 4, 2021

The reason for this change #144 is because Hugo's image processing function was not able to read SVG's width and height (since they can be resized unlimitedly).

And to put images in the gallery format, it's necessary to know their width and height attribute to calculate the flex-grow attribute.

That's why I disabled this feature for SVG images.

@njelich
Copy link
Author

njelich commented Apr 4, 2021

Is there any way to override it, e.g. by supplying a width and height parameter?

e.g. the final comment at a Hugo issue references pulling the viewport parameters of the image for that use.

@CaiJimmy
Copy link
Owner

CaiJimmy commented Apr 5, 2021

Is there any way to override it, e.g. by supplying a width and height parameter?

I think the standard Markdown syntax does not support adding width and height attribute to images.

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

No branches or pull requests

2 participants