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

Usemin replacing meta tag content attributes #608

@azoerb

Description

@azoerb

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions