Add static assets to Apostrophe project, specifica

2019-08-03 20:45发布

问题:

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');
}