Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Usemin replacing meta tag content attributes #608

Open
azoerb opened this issue Dec 11, 2015 · 0 comments
Open

Usemin replacing meta tag content attributes #608

azoerb opened this issue Dec 11, 2015 · 0 comments

Comments

@azoerb
Copy link

azoerb commented Dec 11, 2015

I'm trying to use grunt-usemin and grunt-filerev to version my static files. I use browserify for all concatenation, uglification, etc. So I really just need to version the end files and replace them in my html.

The problem I'm running into is that I have meta tags with content attributes that match one of my filenames.

So I have a revisioned file like:
static/app_name.198615a3.css

as well as meta tags like:
<meta name="apple-mobile-web-app-title" content="app_name">
<meta property="og:site_name" content="app_name">

I've added a pattern option in usemin

usemin: {
  html: ['dist/layout.html'],
  options: {
    assetsDirs: ['static'],
    patterns: {
      html: [
        [/(app_name\.css)/, 'Replacing reference to app_name.css'],
      ],
    },
  }
},

Which works fine for changing the references to app_name.css in layout.html to its versioned counterpart, but unfortunately it's also replacing the meta tag content attributes
<meta name="apple-mobile-web-app-title" content="app_name.198615a3.css">
<meta property="og:site_name" content="app_name.198615a3.css">

Is there a way to only use the patterns for matching, or to somehow ignore specific patterns? Am I going about this incorrectly?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant