0

This Meteor template failed to render the public/calender.svg file but instead it renders a standard placeholder image.
How can I get it to show the content of the calender.svg file? Thanks

<img src="/{{image}}.svg"/>

enter image description here

The content of the file is:

'<svg height="24px" version="1.1" viewBox="0 0 24 24" width="24px"><g fill="none" fill-rule="evenodd" id="miu" stroke="none" stroke-width="1"><g id="Artboard-1" transform="translate(-792.000000, -335.000000)"><g id="slice" transform="translate(215.000000, 119.000000)"/><path d="M805.920365,339 ... " fill="#000000"/></g></g></svg>'

edit
If I change the file to .png then it works.

Fred J.
  • 5,759
  • 10
  • 57
  • 106
  • Does it render the calendar.svg image if you hard code it there? Instead of the spacebars. – gkrizek Aug 22 '16 at 00:18
  • The Template is rendering before the helper is called, so when the template is initially rendered, it can't find the image. I'm not sure how to fix that because I have never done it. This SO post might help: http://stackoverflow.com/questions/26997361/meteor-js-calling-a-template-helper-within-template-rendered – gkrizek Aug 22 '16 at 00:54
  • @TIC if I change the file to `image.png` then it works. – Fred J. Aug 22 '16 at 00:57
  • 1
    does the file indeed start with `' – Christian Fritz Aug 22 '16 at 02:31
  • @ChristianFritz I fixed something in the format as you hinted and it works now. thx – Fred J. Aug 22 '16 at 02:49

0 Answers0