web/_posts/2019-08-11-customize-the-favicon.md

40 lines
1.8 KiB
Markdown
Raw Normal View History

2019-09-30 15:38:58 +03:00
---
2020-04-06 21:11:50 +03:00
title: Customize the Favicon
author: Cotes Chung
2019-09-30 15:38:58 +03:00
date: 2019-08-11 00:34:00 +0800
categories: [Blogging, Tutorial]
tags: [favicon]
toc: false
---
2019-11-16 18:12:26 +03:00
In [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/), the image files of [Favicons](https://www.favicon-generator.org/about/) are placed in `assets/img/favicons/`. You may need to replace them with your own. So let's see how to customize these Favicons.
2019-09-30 15:38:58 +03:00
2020-06-01 09:45:48 +03:00
With a square image (PNG, JPG or GIF) in hand, open the site [*Favicon & App Icon Generator*](https://www.favicon-generator.org/) and upload your original image.
2019-09-30 15:38:58 +03:00
2021-01-09 17:31:43 +03:00
![upload-image](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20190811/upload-image.png)
2019-09-30 15:38:58 +03:00
2019-10-11 19:46:12 +03:00
Click button <kbd>Create Favicon</kbd> and wait a moment for the website to generate the icons of various sizes automatically.
2019-09-30 15:38:58 +03:00
2021-01-09 17:31:43 +03:00
![download-icons](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20190811/download-icons.png){: width="600"}
2019-09-30 15:38:58 +03:00
2019-11-16 18:12:26 +03:00
Download the generated package, unzip and delete the following two from the extracted files:
2019-10-10 19:06:18 +03:00
- browserconfig.xml
- manifest.json
2021-01-09 17:31:43 +03:00
Now, copy the remaining image files (`.PNG` and `.ICO`) from the extracted `.zip` file to cover the original files in the folder `assets/img/favicons/`.
2019-09-30 15:38:58 +03:00
The following table helps you understand the changes to the icon file:
> ✓ means keep, ✗ means delete.
| File(s) | From Favicon & App Icon Generator | From Chirpy |
|---------------------|:---------------------------------:|:-----------:|
| `*.PNG` | ✓ | ✗ |
| `*.ICO` | ✓ | ✗ |
| `browserconfig.xml` | ✗ | ✓ |
| `manifest.json` | ✗ | ✓ |
The next time you build the site, the icon will be replaced with a customized edition.