0

Zurb Foundation's data-interchange works beautifully for me. In development.

But then I build and I end up with this sort of html:

<img alt='Why Believe' data-interchange='[/assets/images/logo.svg, (default)], [/assets/images/logo-square.svg, (medium)]'>
<noscript>
  <img alt='Why Believe' src='/assets/images/logo-e8f041ee.svg'>
</noscript>

Can you spot the problem?

Middleman's build process smartly fingerprints all of the assets, and links to the fingerprinted ones. No "un-fingerprinted" assets get built. I want all of that.

But the asset paths in the data-interchange attribute get no fingerprints. Therefore they work in development, but not once built and deployed.

How can I make it so the data-interchange asset paths also get the fingerprint? (And if middleman calls the -e8f041ee something other than "fingerprint", please let me know!)

chadoh
  • 4,343
  • 6
  • 39
  • 64

1 Answers1

0

If you are going to use asset hashs then you should consider moving your images used by interchange to a new directory so they aren't automatically hashed. If you are not hosting on a CDN based setup, you should consider turning the cash busting hashes off.

For example I place images in source/blog/featured-images rather than /images/blog/... to avoid them being hashed for a similar reason (because I am defining the name via yml frontmatter.

JAMESSTONEco
  • 2,051
  • 15
  • 21
  • I deploy entirely on a CDN, and love asset hashes. – chadoh Dec 17 '14 at 15:26
  • 1
    In that case, I don't know of any way to get at those hashes without digging into the middleman source. I have also seen some examples of people creating their own hashing for middleman which might also be a good approach. – JAMESSTONEco Dec 18 '14 at 14:24