Closed sli1989 closed 6 years ago
Yeah, it's an issue when you use the internal font-awesome library instead of the CDN.
Now the plugin will bundle the /lib/font-awesome/css/font-awesome.css
into the /style.css
, so its font-src will lead a wrong path, that couldn't find it. (the font-src
's result is now /fonts/fontawesome-webfont.woff2
, and not the right path /lib/font-awesome/fonts/fontawesome-webfont.woff2
)
There is now 3 ways to resolve it.
**/font-awesome.min.css
to the config.filter_optimize.css.excludes, like:
filter_optimize:
...
css:
...
excludes:
- '**/font-awesome.min.css'
font-awesome.min.css
, replace the all ../fonts/
with lib/font-awesome/fonts/
Personally, I suggest DO NOT use the second one. Because it will not make the font-awesome.min.css to load asynchronously.
And if you bundle any css referencing other files within relative paths probably would get the same errors. It seems doesn't have a good way to automatically solve these problems, I think I need help to deal with it. 😕
thanks, it's solved. but it seems to take longer time to hexo g
?
Yes, it will take longer time to filter files. Such as it will synchronized bundling files by their sort. And I'm trying to optimize it by using a async way and keep the right orders in the meantimes.
@sli1989 Normally, it will be bundled into the public/style.css
, is there a live demo site that is used the plugin and had questions? I saw your blog seems no problem.
And if you want some files would NOT be bundled into the style.css, you can just add them to the parameter excludes
. (it means not process the files, and keep them loaded as their before)
OK, thanks.
the deployed blog haven't used the hexo-filter-optimize
.
is it right?
and then
hexo clean && hexo g && hexo s