Hot new platform? Niche corner of the internet? Or one specific to your area? This post will guide you through how to add a new social icon to the theme.
Table of contents
显示目录
Merging back to the theme
The maintainer of the theme Sat Naing has said that he intends to only
keep the project supporting only a specific set of popular social icons.
So there is a chance that your icon will not be in the repo, but fear not, it is very easy to add your own!
Getting things to match
The icon set used by the theme come from Tabler and there are a quite a few brands on there.
Adding your icon, by example
For this guide we are going to use the StackOverflow icon as our example.
Find the icon
In this case, we are going to use the
StackOverflow
as an example.
Searching on Tabler for ‘StackOverflow’ we get a single icon https://tabler.io/icons/icon/brand-stackoverflow, we are going to need the svg code, so save it for later.
Clean up
We need to do some tidy up on what the theme provides us.
- remove all classes other than
icon-tabler
- remove width & height
- remove the viewBox
- remove the stroke-width
- remove the stroke
- remove the fill
This should leave you with the following
Now we can add the clean svg code to the src/assets/socialIcons.ts
file in SocialIcons
.
Finally we can configure it for our blog in src/config.ts
under SOCIALS
. Setting active: true
to add it to the site.
Ensure that
href
andlinkTitle
are updated for the corresponding link and label.
Full code for the above steps can be found in this pull request