Emm*_*urd 4 grails resources fonts
我找不到哪里可以告诉grails包含一个字体文件夹与一些font-face(font-awesome).在过去的版本中,它将包含在config.groovy文件中,但它似乎没有版本3中的一个.在哪里可以将此配置告诉grails在生成我的视图时计算此文件夹的数量?
谢谢
我假设您习惯使用资源插件而不是资产管道,这是Grails 3默认使用的.从升级指南:
Step 7 - Migrate Static Assets not handled by Asset Pipeline If you have static assets in your web-app directory of your Grails 2.x application such as HTML files, TLDs etc. these need to be moved. For public assets such as static HTML pages and so on these should go in src/main/resources/public.
TLD descriptors and non public assets should go in src/main/resources/WEB-INF.
As noted earlier, src/main/webapp folder can also be used for this purpose but it is not recommended.
This means you will need to pass your static resources through the asset pipeline plugin, installed by default in Grails 3. What is the asset pipeline?
The Grails Asset-Pipeline is a plugin used for managing and processing static assets in Grails applications. Asset-Pipeline functions include processing and minification of both CSS and JavaScript files. It is also capable of being extended to compile custom static assets, such as CoffeeScript or LESS.
Create a folder in your project at the following location:
grails-app/assets/fonts
Run Code Online (Sandbox Code Playgroud)
Read the documentation on linking to assets and plugins.
Plugins Plugins also can have the same "grails-app/assets" folder and their URL mapping is also the same. This means it can be more important to ensure unique naming/path mapping between plugins. This is also powerful in the sense that a plugin can add helper manifests to be used within your apps like jquery, bootstrap, font-awesome, and more.
这些插件的不同之处在于,其web-app目录中的资产也可以在类似的结构下使用
如果您按照这些说明操作,则应该可以在GSP页面中要求使用font-awesome资源.您需要花一点时间学习资产管道.还有另一种选择,你也可以使用font awesome插件.
| 归档时间: |
|
| 查看次数: |
5073 次 |
| 最近记录: |