krata/_posts/2019-08-11-customize-the-fa...

40 lines
2.0 KiB
Markdown
Raw Normal View History

2019-09-30 14:38:58 +02:00
---
2020-04-06 20:11:50 +02:00
title: Customize the Favicon
2021-12-04 19:29:40 +01:00
author:
name: Cotes Chung
link: https://github.com/cotes2020
2019-09-30 14:38:58 +02:00
date: 2019-08-11 00:34:00 +0800
categories: [Blogging, Tutorial]
tags: [favicon]
---
The [favicons](https://www.favicon-generator.org/about/) of [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/) are placed in the directory `assets/img/favicons/`. You may want to replace them with your own. The following sections will guide you to create and replace the default favicons.
2019-09-30 14:38:58 +02:00
2021-04-29 13:50:23 +02:00
## Generate the favicon
2019-09-30 14:38:58 +02:00
Prepare a square image (PNG, JPG, or SVG) with a size of 512x512 or more, and then go to the online tool [**Real Favicon Generator**](https://realfavicongenerator.net/) and click the button <kbd>Select your Favicon image</kbd> to upload your image file.
2019-09-30 14:38:58 +02:00
2021-04-29 13:50:23 +02:00
In the next step, the webpage will show all usage scenarios. You can keep the default options, scroll to the bottom of the page, and click the button <kbd>Generate your Favicons and HTML code</kbd> to generate the favicon.
2019-09-30 14:38:58 +02:00
2021-04-29 13:50:23 +02:00
## Download & Replace
2019-09-30 14:38:58 +02:00
2019-11-16 16:12:26 +01:00
Download the generated package, unzip and delete the following two from the extracted files:
2019-10-10 18:06:18 +02:00
2021-04-29 13:50:23 +02:00
- `browserconfig.xml`
- `site.webmanifest`
2021-01-09 15:31:43 +01:00
2021-09-29 14:44:00 +02:00
Now, copy the remaining image files (`PNG` and `ICO`) to cover the original files in the folder `assets/img/favicons/` of your Jekyll site. If your Jekyll site doesn't have this directory yet, just create one.
2019-09-30 14:38:58 +02:00
The following table will help you understand the changes to the favicon files:
2021-04-29 13:50:23 +02:00
| File(s) | From Online Tool | From Chirpy |
|---------------------|:---------------------------------:|:-----------:|
| `*.PNG` | ✓ | ✗ |
| `*.ICO` | ✓ | ✗ |
| `browserconfig.xml` | ✗ | ✓ |
2021-04-29 13:50:23 +02:00
| `site.webmanifest` | ✗ | ✓ |
2021-04-29 13:50:23 +02:00
> Note: ✓ means keep, ✗ means delete.
2021-04-29 13:50:23 +02:00
The next time you build the site, the favicon will be replaced with a customized edition.