twitter-bootstrap - 在 Drupal 和 Bootstrap 上加载“Font Awesome”非常慢
问题描述
我在我的“Drupal 8”网站上本地托管“Font Awesome”字体,主题为“Bootstrap”。
我为我的网站使用 SVG 版本。
这是我的bootstrap_subtheme_front_office.libraries.yml
文件:
bootstrap:
version: 3.4.1
js:
bootstrap/js/bootstrap.min.js: {}
css:
component:
bootstrap/css/bootstrap.min.css: {}
../../contrib/bootstrap/css/3.4.1/overrides-cosmo.min.css: {}
fontawesome:
version: 5.7.2
header: true
js:
fonts/fontawesome/js/all.min.js: {}
bootstrap-toggle:
version: 2.2.0
js:
js/bootstrap-toggle.min.js: {}
css:
component:
css/bootstrap-toggle.min.css: {}
global:
js:
js/bootstrap.js: {}
js/back-to-top.js: {}
css:
component:
css/style.css: {}
这是我的bootstrap_subtheme_front_office.info.yml
文件:
name: Bootstrap Sub-Theme Front Office
type: theme
description: 'Uses the Bootstrap framework LESS source files and must be compiled (not for beginners).'
core: 8.x
base theme: bootstrap
libraries:
- bootstrap_subtheme_front_office/bootstrap
- bootstrap_subtheme_front_office/fontawesome
- bootstrap_subtheme_front_office/bootstrap-toggle
- bootstrap_subtheme_front_office/global
regions:
navigation_collapsible_first: 'Navigation (Collapsible first)'
navigation_menu_first: 'Navigation (Menu first)'
navigation_notification_first: 'Navigation (Notification first)'
navigation_logo: 'Navigation (Logo)'
navigation_notification_second: 'Navigation (Notification second)'
navigation_menu_second: 'Navigation (Menu second)'
navigation_collapsible_second: 'Navigation (Collapsible second)'
breadcrumb: 'Breadcrumb'
header: 'Top Bar'
sidebar_first: 'Primary'
highlighted: 'Highlighted'
help: 'Help'
content: 'Content'
sidebar_second: 'Secondary'
footer: 'Footer'
当我在智能手机上测试我的网站显示时,它可以正常工作:
但是我的一些访客,我们在加载“Font Awesome”时遇到了问题。pilice 没有加载,我的印象是互联网浏览器试图加载警察并且他在延迟后放弃了:
我在我的网站上使用了很多“Font Awesome”字体(用于导航、菜单……)。如何纠正这个问题?
解决方案
推荐阅读
- firebase - 如何使用来自 Firebase 存储的图片设置图像视图
- c# - 在 C# 中为依赖解析器创建延迟缓存值?
- windows - 如何在子目录中使用 for 循环运行应用程序
- python - 执行函数,按下按钮后关闭窗口并继续下一个循环
- javascript - 如何将导弹枪管限制在最小和最大角度之间?
- sql - 将单个 sql 列拆分为五个
- python - 无法使用python从mysql数据库中检索数据
- sql-server - 无法从 .Net MVC WebApp 访问数据库
- python - Python脚本无法找到找到下载文件夹并打开文件
- python - 根据键对 JSON 数据进行排序