【发布时间】:2018-12-09 17:44:13
【问题描述】:
我正在处理一个 MVC 5 项目。我已将SummerNote 集成到项目中。现在,您在上面的链接中看到的工具栏有一些图标。 当我运行我的项目时,它在本地运行良好,但是当我部署它时找不到图标。因此,由于我不完全了解整个事情是如何工作的,我通过更改 summernote-bs3.css 和 summernote.css 中的路径来修复部署,但随后本地版本当然坏了。
我为部署修复它的方式发生了变化:
@font-face {
font-family: 'Glyphicons Halflings';
src: url('~/Content/fonts/glyphicons-halflings-regular.eot');
src: url('~/Content/fonts/glyphicons-halflings-regular.eot?#iefix')
format('embedded-opentype'), url('~/Content/fonts/glyphicons- halflings-
regular.woff') format('woff'), url('~/Content/fonts/glyphicons-halflings-
regular.ttf') format('truetype'), url ('~/Content/fonts/glyphicons-
halflings-regular.svg#glyphicons_halflingsregular') format('svg');}
到:
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../Content/plugins/fonts/glyphicons-halflings-regular.eot');
src: url('../Content/pluginsfonts/glyphicons-halflings-regular.eot?#iefix')
format('embedded-opentype'), url('../Content/plugins/fonts/glyphicons-
halflings-regular.woff') format('woff'),
url('../Content/plugins/fonts/glyphicons-halflings-regular.ttf')
format('truetype'), url('~/Content/fonts/glyphicons-halflings-
regular.svg#glyphicons_halflingsregular') format('svg');}
请注意,我将 ~/Content/fonts/ 更改为 ../Content/fonts/。我也对 summernote.css 做了同样的事情。
原因是在我的部署中,我看到有人尝试下载:
https://mysite.azurewebsites.com/plugins/~/content/fonts/.....
但它找不到它,即使 ~ 表示 home,在这种情况下实际上与 ../ 相同。
所以我不太确定如何解决这个问题。这些路径是如何工作的或者它们是从哪里获取的?
感谢您的想法和帮助。
【问题讨论】:
标签: css asp.net-mvc asp.net-mvc-5 summernote