Add static assets to Apostrophe project, specifically images and font files

有些话、适合烂在心里 提交于 2019-12-11 05:27:30

问题


How do I add static assets to my Apostrophe project? The documentation only mentions pushing assets that are JavaScript or LESS files. It makes no mention of other static assets. In particular, I'd like to import a font face into my CSS, but there doesn't seem to be a way to include my OTF and TTF files.


回答1:


You can add static assets such as fonts or images to the /public directory which is automatically made available by the server. You can reference them from the root file path, such as

@font-face {
   ...
   src: url('/fonts/myFont.otf');
}


来源:https://stackoverflow.com/questions/44984368/add-static-assets-to-apostrophe-project-specifically-images-and-font-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!