Sign in

SVG icon not rendered when sync to website

  • This topic has 5 replies, 2 voices, and was last updated 2 weeks, 4 days ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #6366
    shaun2k

    Hi,

    I inserted the Facebook SVG icon in my post (Block Editor, HTML Block) using the same code as the Social Media share buttons in footer.hbs.

    The icon would render correctly in preview

    <svg viewBox="0 0 32 32">
    <path d="M30.234 0H1.766A1.766 1.766 0 0 0 0 1.766v28.468A1.766 1.766 0 0 0 1.766 32h15.326V19.608h-4.17v-4.83h4.17v-3.56c0-4.134 2.524-6.385 6.21-6.385a34.216 34.216 0 0 1 3.727.19v4.32h-2.557c-2.005 0-2.394.953-2.394 2.35v3.084h4.78l-.622 4.83h-4.16V32h8.154A1.766 1.766 0 0 0 32 30.234V1.766A1.766 1.766 0 0 0 30.234 0z"></path>
    </svg>

    However, when sync to website, the handlebar codes remained unrendered

    <svg><use xlink:href="{{@website.assetsUrl}}/svg/svg-map.svg#facebook"></use></svg>

    Thanks.

     

    #6367
    Bob

    any URL?

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #6368
    shaun2k
    This reply has been set as private.
    #6369
    Bob

    Ok, I got it. The problem is that you are trying to execute handlebars into the post body.

    {{@website.assetsUrl}}
    

    So, replace the above code with the absolute URL of your website. It should work.

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #6370
    shaun2k
    This reply has been set as private.
    #6371
    shaun2k
    This reply has been set as private.
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘SVG icon not rendered when sync to website’ is closed to new replies.