htmlyew

How to connect favicon to a website in yew.rs?


I am creating a website through a framework "Yew.rs " and I can't connect favicon.ico.

I tried to connect it with this method:

<head>
  <link rel="icon" href="favicon.ico"><!-- 32×32 -->
</head>

but it doesn't work. Can you tell me how I can do this?


Solution

  • I solved the problem by adding favicon.ico to the src folder and linking to it in the index.html adding:

    <link data-trunk rel="copy-dir" href="./src/"> 
    <link rel="icon" href="./src/favicon.ico" type="image/x-icon" />
    

    This way you can link any folder and it will be copied to the dist folder.