Most of this is taken from the CONTRIBUTING.md file from the Simple Icons project
- Table of Contents
- Get software
- Setup Inkscape
- Identify icon
- Adding an icon
- Name the icon
- Optimizing an icon
- Annotating an icon
- Updating the README
- Workflow for publishing a new version
- Download Inkscape. It's free for Windows, Mac, and Linux.
- Install svgo (this is used to optimize SVGs)
- Install
scour
on Linux (not sure if this is needed on Windows or Mac)- Arch =
sudo pacman -S scour
- Ubuntu =
sudo apt-get install python3-scour
- Arch =
You only need to do this once:
Edit-->Preferences-->Behavior-->Transforms-->Scale stroke width
= Enabled
Only homelab-related icons will be added (e.g., Burger King will not be added). In addition, the following icons will not be added:
- Government organizations
- Flags and banners
- Universities or educational institutions
When possible, icons should be sought from official sources first, only then falling back on unofficial sources. The order below should be the preferred order.
- About pages, Press pages, Media Kits, and Brand Guidelines (example here and here)
- Website images (example here)
- GitHub repositories (example here)
- Wikipedia (example here)
- Open each file with Inkscape
- Resize the document and viewbox to 48x48
- Select all elements of the icon and create a group (this helps during resizing/alignment)
- Resize the icon to 48x48 (ensuring to retain ratio)
- Center the icon on page both horizontally and vertically (the icon should be touching at least two sides of the document now)
- Clean up document (
File--->Clean Up Document
) - Save the SVG file to the
assets
directory- Be sure to use
Optimized SVG
filetype - On the
SVG Output
tab:- Check
Remove metadata
- Check
Remove comments
- Uncheck
Embed raster images
- Check
Enable viewboxing
- Check
- Be sure to use
Each icon will have two names:
- A filename (e.g.,
filename.svg
) - A display name
Adhere to the following rules when choosing filenames:
- Use the lowercase ISO basic Latin alphabet with no whitespaces.
Correct Incorrect github.svg
GitHub.svg
microsoftedge.svg
microsoft edge.svg
- Replace symbols in the brand name with their spelled-out words.
Correct Incorrect cplusplus.svg
c++.svg
diagramsdotnet.svg
diagrams.net.svg
- Use a dash (
-
) to indicate a separate version of the icon.bash-dark.svg bash-light.svg
- When a brand is part of the product name, use it in the filename.
Correct Incorrect apachesolr.svg
solr.svg
- Run
svgo
to optimize the image (the default settings are fine)svgo assets/filename.svg
Manually check each icon to ensure it HAS these settings:
- The SVG namespace
xmlns="http://www.w3.org/2000/svg"
- A 48x48 viewbox
viewBox="0 0 48 48"
Below is a partial example of a file.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">...</svg>
Manually check each icon to ensure it DOES NOT have these settings:
xlink
- This is usually caused by cloned shapes. You can remove this by selecting the clones and choosingEdit-->Clone-->Unlink Clone
.- This might be harder to remove depending on the design. Try your best.
height
orwidth
- Instead, useviewBox
as show above.- Make sure there is no
png
data encoded into each file.
Add the icon to the icons.json
file. There are four lines for each icon:
- Path: The path in the
assets
directory to the icon - Name: The display name that will be shown in the final markdown file
- A link to the source where you found the SVG file
- A link to the brand's guidelines
- If none exist, leave blank
- The guidelines may be the same as the source
When adding to the icons.json
file, use the following guidelines:
- Use alphabetical order by the display name (not the filename)
- The display name can have symbols (e.g.,
C++
orDiagrams.net
) - Separate version of the icon should have descriptive display names (e.g.,
Bash (dark)
andBash (light)
) - The display name should be stylized as per the brand's requirements (e.g.,
ownCloud
instead ofOwnCloud
) - The display name can have more information about the icon (e.g., the Linux penguin's name is Tux!)
A full example is below:
{
"path": "./assets/gimp.svg",
"name": "GIMP (Wilber)",
"source": "https://gitlab.gnome.org/Infrastructure/gimp-web/blob/master/themes/newgimp/static/images/gimp.svg",
"guidelines": "https://www.gimp.org/about/linking.html"
},
- Install Python requirements
python3 -m venv venv source venv/bin/activate pip3 install -r requirements.txt
- Run the Python script
python3 scripts/convert_json.py
- Get current git tags
git tag
- Increment the version number in
package.json
to match a new git tag - Do git work
git add . git commit -m "Text goes here" git push git tag -a X.Y.Z -m "X.Y.Z - Text goes here" git push origin X.Y.Z
- Publish to NPM
npm publish --access public