Add Favicon to Hexo Blog

I made a Hexo blog. However, I cannot find out where to add the icon. I tried adding it to different folders, but it was not found.

Does anyone know where it should be added, or if something else I need to update.

+6
source share
5 answers

It depends on the topic you are using, check the topic documentation and source.

Some themes, such as apollo , support the favicon configuration parameter ( theme_config.favicon parameter in_config.yml).

If the theme does not support the custom icon, just add the source/favicon.ico file and it will be requested automatically by the browser .

+4
source

I use Landscape, the default theme at the time of writing.

 blog\blog\node_modules\hexo\node_modules\hexo-cli\assets\themes\landscape\_config.yml 

At the bottom of the file you will find the "Miscellaneous" section.

 # Miscellaneous google_analytics: favicon: blog\themes\landscape\source\css\images\favicon.ico twitter: google_plus: fb_admins: fb_app_id: 

Windows can be directional directional when it comes to oblique worms, so try the opposite direction if you are using a PC. This helped me, and I was able to use the .ico file as well as the .png file.

If you still need a placeholder image, I used Favicon.cc and had great results.

+2
source

Konstantin Pavlov is right. for example, I use the theme theme hexo-theme-next. I am changing the code in the themes / next / _config.yml.

 # Put your favicon.ico into `hexo-site/source/` directory. favicon: images/favicon.ico 

I put my favicon.ico in /next/source/images/favicon.ico themes
well done.

0
source

you can add favicon.ico to the source floder and add a line to blog/_config.yml

 favicon: favicon.ico 

So you know that source is the root path

0
source

Add this to the main part of the html code ...

  <head> <title>Test Page</title> <link rel="icon" type="image/png" href="http://www.w3.org/Icons/w3c_home"> </head> 

See the W3C website for more on this: How to FavIcon

It is also useful to check the source of the page by looking at the console, as it will tell you if there were any problems retrieving the icon.

-1
source

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


All Articles