How do I upload an SVG?

#1

Hi!
On our company website we use a grid of client logos (all SVG), that are formatted with some HTML into a CSS grid. Before, when I needed to update this grid, I’d import the logo (SVG-file) by adding it as an image, and then use the pointer of that file (something like /content/2018/03/xxxxx.svg) in my HTML, in order to get the logo into the grid.

However, when trying to use the same operation now, I’m unable to upload the SVG-file because Ghost no longer supports uploading SVGs for some reason, either using ‘image’ or ‘markdown’. So, how am I supposed to use SVGs on my site, if I can’t upload them to the server?

And no, bundling the logos with the theme is not something I want to do (if that would even work), as that complicates the process tremendously.

Cheers,
Chris

#2

I was kind of hoping for a simple solution to this, that I had missed something obvious. Now I’m worried that uploading SVGs is simple not supported anymore, which is a pretty big issue for us.

#3

Hey @Christofer :wave: SVG’s are definitely supported as an uploaded image format which you can use in post content and other places. From a quick check, it seems like there’s a bug in the default Casper theme (assuming that’s what you are using).

My suspicion is it has something to do with default height/width for .svg format. When I tried loading up the same post on the alternative theme (Attila Version 1.7.6) the SVG showed up just fine. Will file a bug in Casper theme :+1:

In a meanwhile just as a very hacky way to get svg’s displayed back on your instance try setting .kg-image-card: min-width: 100%; in the CSS (warning I’m no expert in CSS :grimacing:)

1 Like
#4

Created an issue to track progress here:

#5

Ok, thanks! Turns out the file I tried uploading was corrupted (or non-standard…or something), which is why Ghost threw an error saying the file type isn’t supported, leading me down this rabbit hole. I should’ve tried with a different .svg right away. Anyway, all is good now. :slight_smile:

#6

Good to hear :slight_smile: Was still a good report as had found a legitimate bug in our theme!