The favicon was not displayed at all. I didn't understand even if I looked it up.
Favicon placement`` Favicon location
If you look it up in, it will appear "in the root directory" and "in the same hierarchy as index.html".
There was also a story that "If you write a link in the HTML head (even an images file), it's okay."
Isn't it? ?? ??
HTML, CSS
project
├ index.html
├ favicon.ico ←--Root, index.Same hierarchy as html
├ css
│ └ stylesheet.css
└ images
└ photo.png
When JS joins
project
├ index.html
├ favicon.ico ←--Root, index.Same hierarchy as html
├ css
│ └ stylesheet.css
├ js
│ └ common.js
└ images
└ photo.png
It's kind of like that, but when I looked it up, it came out.
It has to change with the addition of Flask.
Search by combining the Flask Python favicon folder layout
.
project
├ static
│ ├ css
│ │ └ stylesheet.css
│ ├ js
│ │ └ common.js
│ ├ images
│ │ └ favicon.ico ←--┐
│ └ favicon.ico ←--In static (or even in images)
├ templates
│ └ index.html
├ app.py
└ servise.db
The static file had to be in static. Remember that it's the same as putting a link in the HTML head (CSS, JS). The page I made for Flask practice at the programming school also looked like this, so I should have seen it properly. Also, since it was another worker who created this back-end folder, I used it without thinking about the reason why the layout was different.
[How do I deploy a favicon on Heroku? ](Https://www.it-swarm.dev/ja/favicon/heroku%E3%81%AB%E3%83%95%E3%82%A1%E3%83%93%E3%82%B3% E3% 83% B3% E3% 82% 92% E3% 83% 87% E3% 83% 97% E3% 83% AD% E3% 82% A4% E3% 81% 99% E3% 82% 8B% E3% 81% AB% E3% 81% AF% E3% 81% A9% E3% 81% 86% E3% 81% 99% E3% 82% 8C% E3% 81% B0% E3% 82% 88% E3% 81% 84% E3% 81% A7% E3% 81% 99% E3% 81% 8B% EF% BC% 9F / 956952696 / "it-swarm.dev") Adding a favicon
Recommended Posts