我正在努力寻找任何最新的安装指南,以在ASP.NET Core 2.2中安装Font Awesome
I am struggling to find any up to date installation guide for installing Font Awesome in ASP.NET Core 2.2
我尝试将手动文件导入到项目中文件夹目录,然后尝试使用NuGet软件包路由,但没有任何效果,因为我遵循的所有指南均引用了2.2中不存在的步骤和文件夹/文件
I've tried a manual file import to the project folder directory, then tried the NuGet package route but nothing works because all the guides I follow make reference to steps and folders/files that don't exist in 2.2
到ASP.NET Core可能无法解决这种情况:(
Being new to ASP.NET Core is likely not helping the situation :(
推荐答案有很多方法可以完成此操作,但是我认为
There are many ways to accomplish this, however in my opinion the easiest way to get up and running quickly is A.
注意:您不会对所有图标都具有智能感知,但是没有没什么大不了的,无论如何,我最终都在视觉上查找我想要在font-awesome网站上的哪个图标。如果您发现您确实需要智能感知或想要在断开连接的环境中使用超赞的字体,请参阅B节。
Note: you will not get intellisense for all of the icons, however there isn't much to it, and I wind up visually looking up which icon I want on font-awesome's site anyways. If you find you really need the intellisense or want to work with font-awesome in a disconnected environment, see section B.
B:一次安装
B: One time 'install'
<!-- CSS --> <environment include="Development"> <script src="~/lib/fontawesome-free-5.10.1-web/css/all.css"></script> </environment> <!-- ... ---> <!-- JS --> <environment include="Development"> <script src="~/lib/fontawesome-free-5.10.1-web/js/all.js"></script> </environment>
注意:在此示例中,我将CSS和JS引用放置到Font Awesome仅适用于开发环境,这意味着您仍应使用A节,但将CDN版本放在 production节中。
Note: In this example, I placed the CSS and JS reference to Font Awesome for the development environment only, which means you should still use section A, but place the CDN version inside the 'production' section.
<environment exclude="Development"> <script src="use.fontawesome/abcdef1234.js"></script> </environment>
注意: abcdef1234.js 不是真实文件,则在注册CDN软件包时会在电子邮件中获得您的特定文件
Note: abcdef1234.js is not a real file, you'll get your specific file in the email when you sign up for the CDN package
注意:CDN版本没有需要的CSS文件添加,将其包装在JS文件中。
Note: The CDN version does not have a CSS file you need to add, it's wrapped up in the JS file.
如果您确实需要比实际更多的软件包我强烈建议您使用ASP.NET Core附带的字体和超棒的字体,通过@Tony Ngo之类的包管理器获取您的库,并且 LibMan 一样好就像任何开头一样。
If you do need more packages than what is included with the ASP.NET Core and font awesome, I would highly recommend using moving to getting your libs through a package manager like @Tony Ngo pointed out, and LibMan is as good as any to start with.
更多推荐
如何使用Visual Studio 2019在ASP.NET Core 2.2中安装Font Awesome
发布评论