RealFaviconGenerator / gulp-real-favicon

Gulp plugin to generate a multiplatform favicon with RealFaviconGenerator
76 stars 6 forks source link

Auto `versioning` from file hash #5

Open HarryBurns opened 8 years ago

HarryBurns commented 8 years ago

Hello again!

RealFaviconGenerator provides versioning future. It makes links in HTML looks like:

<link rel="manifest" href="manifest.json?ver=416270658374">

In config:

//...
versioning: {
    paramName: "ver",
    paramValue: "416270658374"
}
//...

It would be great to have versioning: "auto" option, that will calculate ?ver=... automatically from file's hash.

This feature will be very handy :)

HarryBurns commented 8 years ago

The gulp-hash plugin could help.

haydenbleasel commented 8 years ago

@HarryBurns According to the API docs:

When this section is set to true (ie. versioning: true), versioning is generated.

So just add versioning: true and it should be generated for you. If it doesn't work, then ask @phbernard haha. Piping to gulp-hash is also an option post-API-call but might be a hassle.

HarryBurns commented 8 years ago

@haydenbleasel According to API docs:

When this section is set to true (ie. versioning: true), versioning is generated. The query parameter name is v and the value is a hashed timestamp.

I was talking about hash of file contents, not hashed timestamp :)

But, I think it would be better to move this issue to favicons. Cause RFG web-service is more about manual generation, whilst favicons is about CI and automation of build process.

haydenbleasel commented 8 years ago

@HarryBurns That is true. Typically I'd say use gulp-favicons and pipe it to gulp-hash but I don't think you can easily affect the metadata in this way, so it may have to be integrated. Let's move this to a new issue on Favicons.

phbernard commented 8 years ago

Oh wow, I didn't see that one, sorry :(

This is already possible. Auto-everything:

//...
versioning: true
//...

Parameter name is TheVersion and auto-timestamp:

//...
versioning: {
    paramName: "TheVersion"
}
//...
haydenbleasel commented 8 years ago

@phbernard Yeah but he wants to hash by file contents rather than timestamp. Possible Feature Request for RFG.

phbernard commented 8 years ago

Oh, right, thank of for pointing this out.