SimpleIcons Badge Generator is a CLI tool written in Go that allows you to generate and download badges for various services using icons from SimpleIcons. The badges can be customized with a label, background color, and font color. The tool also provides an option to generate HTML code to embed the badges.
- Generate and download badges for multiple services using SimpleIcons.
- Customize badge labels, background colors, and font colors.
- Specify a destination directory for saving badges.
- Optionally generate an HTML file to embed the badges.
-
Clone the repository:
git clone https://github.com/your-username/simpleicons-badge-generator.git cd simpleicons-badge-generator
-
Build the application:
For macOS:
GOOS=darwin GOARCH=amd64 go build -o simpleicons-macos main.go
For Linux:
GOOS=linux GOARCH=amd64 go build -o simpleicons-linux main.go
-
Make the binary executable:
chmod +x simpleicons-macos chmod +x simpleicons-linux
./simpleicons-macos <service1>, <service2>, ...
./simpleicons-macos Swift, UIKit, Jekyll
-
Enter the destination directory: You will be prompted to enter the directory where you want to save the badges. The directory will be created if it doesn't exist.
Enter the destination directory: badges
-
Enter the text on the badge: For each service, you will be prompted to enter the text that should appear on the badge.
Found icon for Swift (computed slug: swift) with color #F05138 Enter the text on the badge: Swift Language
-
Confirm HTML file generation: After downloading all the badges, you will be asked if you want to generate an HTML file to embed the badges.
Do you want to create an HTML file to embed the badges? (yes/no): yes
If you confirm, an HTML file named
badges.html
will be created in the specified destination directory.
- The badges will be saved in the specified destination directory with the following naming convention:
<label_text>-badge.svg
. - If HTML generation is confirmed, an HTML file
badges.html
will be created with<img>
tags for each badge.
<img alt="swift" src="swift_language-badge.svg" />
<img alt="uikit" src="uikit_framework-badge.svg" />
<img alt="jekyll" src="jekyll_static_site-badge.svg" />
- If a service is not found, the tool will skip it and continue with the next service.
- If there are any errors during the download or file creation process, an error message will be displayed.
This project is licensed under the MIT License. See the LICENSE file for details.
- SimpleIcons for providing a collection of free SVG icons.
- Shields.io for generating the badges.