环境是作为Web应用程序部署的独立脚本,具有HTMLService()
:
function doGet() {
return HtmlService.createTemplateFromFile('index').evaluate();
}
// see: http://stackoverflow.com/a/39309690
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename)
.getContent();
}
我可以这样链接到Font Awesome css文件index.html
:
<?!= include('css_font_awesome'); ?>
这将链接到css_font_awesome.html
其中包含<style>
标签内样式的链接。
但我怎么链接的.eot
,.woff
,.ttf
和.svg
文件中的字体真棒CSS文件,即在:
@font-face {
font-family: 'FontAwesome';
src: url('fontawesome-webfont.eot?v=4.6.3');
src: url('fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'), url('fontawesome-webfont.woff2?v=4.6.3') format('woff2'), url('fontawesome-webfont.woff?v=4.6.3') format('woff'), url('fontawesome-webfont.ttf?v=4.6.3') format('truetype'), url('fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
我认为您可以使用CDN通过link标签来包含FontAwesome样式表。
打开index.html并将以下行粘贴到头部。
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句