Favicon Generation - Setup Guide
Automatic Script
A Python script has been created at: scripts/generate_favicon.py
This script will generate favicon files from your profile image.
To Run the Script:
Step 1: Install Pillow (if not already installed)
pip3 install Pillow
Step 2: Run the favicon generation script
cd /Users/kostapet/git/PetyoKostakov.github.io
python3 scripts/generate_favicon.py
Step 3: Verify files were created
ls -la favicon* apple-touch-icon.png
You should see 4 files created.
What the Script Does:
- Loads your profile image:
assets/PetyoKostakovProfile.jpg - Crops it to a square (removes any rectangular edges)
- Generates 4 favicon files:
favicon.ico(32x32) - Classic browser tab iconfavicon-32x32.png(32x32) - Modern PNG formatfavicon-16x16.png(16x16) - Small iconapple-touch-icon.png(180x180) - iOS home screen icon
Expected Output Files:
After running the script, you should see these files in your project root:
favicon.ico
favicon-32x32.png
favicon-16x16.png
apple-touch-icon.png
HTML Integration:
The favicon links have already been added to _layouts/default.html:
<!-- Favicon links -->
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
Testing:
- Run the script:
python3 scripts/generate_favicon.py - Verify files exist:
ls -la favicon* apple-touch-icon.png - Start Jekyll:
bundle exec jekyll serve - Check browser tab - you should see your profile photo as the favicon
- On mobile - “Add to Home Screen” will use the apple-touch-icon
Troubleshooting:
If the script doesn’t run:
- Make sure PIL/Pillow is installed:
pip3 install Pillow - Make sure the profile image exists:
ls assets/PetyoKostakovProfile.jpg - Check Python is available:
python3 --version
Dependencies:
Required: Pillow (Python Imaging Library)
Install if needed:
pip3 install Pillow
Manual Alternative
If the script doesn’t work, you can:
- Use an online favicon generator: https://www.favicon-generator.org/
- Upload your profile image
- Download the generated files
- Place them in your project root
Status: Script ready to execute. Run it to generate your favicons!