Replies: 3 comments 4 replies
-
It's also available on jsdelivr, for example https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/svgs/solid/carrot.svg |
Beta Was this translation helpful? Give feedback.
3 replies
-
希望能同时支持阿里巴巴矢量图标库,大部分国内社交媒体的图标都来自这里 |
Beta Was this translation helpful? Give feedback.
0 replies
-
阿里巴巴矢量图标库的一个问题是图标来源比较杂,而且有重复的图标。需要设法做一些预处理,不然内联 svg 定位比较麻烦,难以保证图标的大小、位置是统一的。 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
English
There was a discussion about FontAwesome before, theme-next/hexo-theme-next#505 ,and the main problems of FA is
So, converting webfont to inline svg is a good solution, it can make our theme:
However, inline svg also has shortcoming.
npm i
, or add additional plugins after cloneAbout webfont
I think inline SVG is better than WebFont. Webfont is more of a packaging tool that packs the ICONS together. It has the problems mentioned in the Github article and is more complex than inline SVG
Dynamic loading scheme
For example, generate the SVG icon we need in an 'SVG' folder as follows, and then download it and add it to the page via innerHtml
|--svg
|----icon1.svg
|----icon2.svg
More icon support
Recently, I wrote a svg generation plug-in: hexo-icon-svg-core, which can support multiple Icon library (I am a little disgusted with FA, so I want to replace it gradually)
The basic Api is:
If you have any ideas or improvements to the Api, you can bring them up as well
And this plugin is currently released under @jiangtj scope, so if NexT uses inline SVG, I will move this plugin to the NexT team, it's easy 😂
Question: Can you accept the following installation process?
//... same
Or you can clone the entire repository and install hexo-icon-svg-core:
$ cd hexo-site $ git clone https://github.com/next-theme/hexo-theme-next themes/next $ npm install hexo-icon-svg-core
中文
之前有过对于FontAwesome的讨论,theme-next/hexo-theme-next#505 ,FA目前主要的问题
所以,将webfont转换为内联svg是个不错的方案,他可以使我们的主题
但是,内联svg的存在不足
npm i
的方式使用主题,或者在clone后额外添加相关插件关于webfont打包
我认为的内联svg比webfont更好,webfont更像是个打包工具,将用到的图标一起打包,他有github文章中提到的问题,同时相对于内联svg更加复杂
动态加载方案
例如,像下面那样在一个
svg
文件夹下生成我们需要的svg图标,然后需要时,下载并通过innerHtml添加到页面内|--svg
|----icon1.svg
|----icon2.svg
更多图标支持
最近一段时间,我编写了一个svg生成插件:hexo-icon-svg-core,能很好的支持多个图标库(我对FA有点厌恶,所以想逐步替换)
基本的Api是:
如果你们对于Api有任何想法或者改进,也可以提出来
而且这个插件目前发布在@jiangtj范围下,所以如果NexT采用内联svg,我会将这个插件转移到NexT团队内,很方便转移:joy:
问题:你能接受以下的安装过程么?
//...
或者你可以clone整个仓库,同时添加 hexo-icon-svg-core 插件
$ cd hexo-site $ git clone https://github.com/next-theme/hexo-theme-next themes/next $ npm install hexo-icon-svg-core
Beta Was this translation helpful? Give feedback.
All reactions