How to add an icon to a web page tab in a blog

How to add an icon to a blogdown website? I use the minimal theme. I tried adding a line to config.toml favicon = imgPath , and I also tried moving 'favicon.ico' to a static folder, but none of them worked.

+5
source share
1 answer

If you have a file named favicon.ico in the root directory, most browsers will use it. The easiest way is to add favicon.ico to the static directory (so Hugo will copy it to the root directory), see here .

Favicon is declared in the <head> element. In the minimal topic, the <head> element is defined in the header.html file.
As you can see, the minimal theme does not support favicon support.

First check if there is a layouts/partials/header.html .
If this file does not exist, copy the themes/minimal/layouts/partials/header.html file into the layouts/partials directory (you may need to create this directory).

You need to modify the layouts/partials/header.html .
Add after opening the <head> :

 <link rel="icon" type="image/png" href="{{ "imgPath" | relURL }}"> 
+5
source

Source: https://habr.com/ru/post/1275003/


All Articles