Hello!
I have a text/css
file in the sitemap with the Path stylesheets/branding.css
and the Build Path (for instance) stylesheets/branding-663bb1d3.css
.
I also have an image/svg+xml
file, fleuron.svg
which needs to reference this path inside of an xml-stylesheet
element,
<?xml-stylesheet href="#{}" ?>
Inside of the layouts/layout.haml
file, I’m able to reference this stylesheet simply:
= stylesheet_link_tag :branding
but I can’t use that to invoke an xml-stylesheet.
What is the right way for me to invoke the build path of this file inside the interpolation? Any help is appreciated! If I’m misunderstanding something, please, let me know!
Thanks,
Jonathan Caprell
Edit: I was able to piece together a solution.
Middleman helpers are based upon Padrino helpers. This piece of documentation references an asset_path
helper in Padrino, which I was able to invoke in this way:
-# source/images/fleuron.svg.haml
…
<?xml-stylesheet href="#{ asset_path(:css, :branding) }" ?>
…
This gave me exactly what I was looking for upon build,
<?xml-stylesheet href="/stylesheets/branding-663bb1d3.css" ?>