没有加载Meteor 0.7.0.1的Bootstrap glyphicons

时间:2013-12-24 23:45:01

标签: twitter-bootstrap fonts meteor twitter-bootstrap-3

图标不再渲染(显示为小方块),尽管我所做的唯一更改是从Meteor 0.7.0更新到Meteor 0.7.0.1

我收到这些警告

Resource interpreted as Font but transferred with MIME type text/html: "http://localhost:3000/client/fonts/glyphicons-halflings-regular.woff". Resource interpreted as Font but transferred with MIME type text/html: "http://localhost:3000/client/fonts/glyphicons-halflings-regular.ttf". Resource interpreted as Font but transferred with MIME type text/html: "http://localhost:3000/client/fonts/glyphicons-halflings-regular.svg".

我看到question后检查了我的目录,但我没有看到问题:

$ ls
total 64 
drwxr-xr-x@  4 bdean  staff    136 Oct 22 14:43 private/
-rw-r--r--   1 bdean  staff     93 Dec 11 14:31 smart.json
drwxr-xr-x   3 bdean  staff    102 Dec 11 14:31 server/
drwxr-xr-x   3 bdean  staff    102 Dec 11 14:31 public/
drwxr-xr-x   5 bdean  staff    170 Dec 11 14:31 lib/
drwxr-xr-x   3 bdean  staff    102 Dec 11 14:31 collections/
drwxr-xr-x   6 bdean  staff    204 Dec 11 14:31 client/
-rw-r--r--   1 bdean  staff   2129 Dec 11 14:31 README.md
-rw-r--r--   1 bdean  staff     31 Dec 11 14:31 .gitignore
drwxr-xr-x   7 bdean  staff    238 Dec 11 14:36 .meteor/
-rw-r--r--@  1 bdean  staff  12292 Dec 20 09:09 .DS_Store
drwxr-xr-x   6 bdean  staff    204 Dec 24 13:38 packages/
-rw-r--r--   1 bdean  staff    718 Dec 24 13:38 smart.lock
drwxr-xr-x  12 bdean  staff    408 Dec 24 14:27 .git/

$ ls public/fonts
lrwxr-xr-x  1 bdean  staff  37 Dec 11 14:31 public/fonts@ -> ../packages/bootstrap3-less/lib/fonts
$ ls -f public/fonts/
total 304
drwxr-xr-x  6 bdean  staff    204 Dec 11 14:36 ./
drwxr-xr-x  5 bdean  staff    170 Dec 11 14:36 ../
-rw-r--r--  1 bdean  staff  20290 Dec 11 14:36 glyphicons-halflings-regular.eot
-rw-r--r--  1 bdean  staff  62850 Dec 11 14:36 glyphicons-halflings-regular.svg
-rw-r--r--  1 bdean  staff  41236 Dec 11 14:36 glyphicons-halflings-regular.ttf
-rw-r--r--  1 bdean  staff  23292 Dec 11 14:36 glyphicons-halflings-regular.woff

1 个答案:

答案 0 :(得分:3)

看起来你的字体没有被正确引用:

您的字体位于/public/fonts,但/client/fonts正在请求它们。看起来它是用于字体的路径的问题。

这是此软件包的已知问题,请参阅https://github.com/eprochasson/bootstrap3-less/issues/3

如果你想修复它,你必须改变https://github.com/eprochasson/bootstrap3-less/blob/master/bootstrap.lessimport#L2

的路径

所以它是一个本地路径(这样的东西,所以它使用/public/fonts处的文件):

@icon-font-path: "/fonts/";