RealFaviconGenerator / gulp-real-favicon

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

Leading slash in URLs #3

Open HarryBurns opened 8 years ago

HarryBurns commented 8 years ago

Hello there!

Is it possible to remove leading slash in URLs when iconsPath parameter is set to empty string?

<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
phbernard commented 8 years ago

That would be a change in RFG itself, not in the Gul plugin.

This makes sense, as an empty string would explicitly means "no path at all". But this change might have implication in other parts so I need to investigate this seriously.

I'm curious: why would you want to remove the slash?

HarryBurns commented 8 years ago

It is all about relative path stuff. If my index.html located in http://localhost/foobar/ This link

<link rel="shortcut icon" href="/favicon.ico?ver=95763">

will lead to Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost/favicon.ico?ver=95763

haydenbleasel commented 8 years ago

@HarryBurns Have you considered using the files_location property? e.g.

"files_location": {
    "type": "path",
    "path": "/foobar/"
}

See the API docs for more details.

HarryBurns commented 8 years ago

@haydenbleasel No, it will not work this way. http://localhost/foobar/ is just a virtual folder on server of my webapp. I don't know were my webapp will be deployed, so I can't rely on it during build process.

jheadley commented 7 years ago

Same situation for our team. We would like this as well. We don't know that when deployed, the path will always be /foobar or whatever. For now, we have it generating everything with iconsPath: 'assets/images' because that will get us the right values in index.html knowing that not being in the root is not ideal.

jheadley commented 7 years ago

For now, it seems that using iconsPath: './' will produce links in index.html that work in this situation.