Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

directly embed element as site logo

  • #3578
    Avatar photo[anonymous]

    I read the (closed) forum topic “Website Logo SVG”

    https://forum.getpublii.com/topic/website-logo-svg/

    Publii puts the svg in an element. What’s the best way to embed logo.svg directly in the page markup?

    #3582
    Avatar photoBob
    [anonymous] wrote:

    Publii puts the svg in an element. What’s the best way to embed logo.svg directly in the page markup?

    I think you should edit the top.hbs or navbar.hbs file located in the partials folder ‎⁨(Documents ▸ ⁨Publii⁩ ▸ ⁨sites⁩ ▸ ⁨YOUR_SITE ▸ ⁨input⁩ ▸ ⁨themes⁩ ▸ ⁨YOUR_THEME ▸ partials)

    #3587
    Avatar photo[anonymous]

    So in other words don’t use the upload dialog to upload the logo, but rather include it in the theme. Yeah, I’m doing that, but there’s another (minor) issue: I have two header files that need logo.svg. So I want logo.svg to be a partial, that way I can just include it. But the extension must be .hbs, but the logo has .svg. I can rename it to logo.svg.hbs, but that’s a little clunky, since my editor won’t treat .svg.hbs as an svg file. Any thoughts? I searched the web for ways to include files with different extensions, but haven’t figured it out yet.

    If there’s no solution, then I’ll have to go the clunky route and rename the file if I need to edit it, then rename it back before building the site.

    #3592
    Avatar photoBob

    I can see only one reason why it is worth embedding the SVG file in a different way than the default one – its control e.g. via CSS.

    So if you need to embed your SVG file into the theme source file put the code in two places instead of creating the hbs file.