Page 1 of 1

how to add favicon to your website?

Posted: Sun Jul 31, 2016 7:51 am
by Sesztak
Dear JS-Support,

is there any way to add favicon to your website from CSHTML5 project (not to edit index.html directly)?

Background info: if we want to add favicon to a web site we should edit start page (e.g. index.html) directly, e.g.:
add the following code to the <head> element:

<link rel="icon" href="http://example.com/favicon.png">
or
<link rel="shortcut icon" href="myCustomXYZFavicon.PNG">

So, our question: is it possible to do that from VisualStudio/CSHTML5 project and how?

(it's not practical to edit index.html manually as above stated, as this file is allways overwritten by CSHTML5 build)

Thanks in advance,
Best Regards,
Péter

Re: how to add favicon to your website?

Posted: Mon Aug 24, 2020 1:54 pm
by hrodriguez
Hello

Could you tell me how did you address this issue?

Thank you

Re: how to add favicon to your website?

Posted: Tue Aug 25, 2020 4:34 pm
by MichaelHughes
I edit the index.html file as I require a loading screen and I prefer the app stuff in the dir as it was version 1.
So I have a routine that is run after compilation to "tidy up". Mine is part of the compilation process but I thought you could add it as a post compilation action in version 2.

However I also believe that if you put the favicon in the route directory the browser will also pick it up without the entries in the index.html