Node.js 在重影安装中引用@fontface

Node.js 在重影安装中引用@fontface,node.js,fonts,ghost-blog,Node.js,Fonts,Ghost Blog,我刚刚用它生成了一个个性化的字体 当我尝试在我的Ghost安装中引用它时,文件总是返回404。以下是我所做的: 我在/content/themes/[theme name]/assets/fonts文件夹中添加了生成字体文件的完整文件夹 我引用default.hbs中的main.css文件 像这样: <link rel="stylesheet" type="text/css" href="{{asset "fonts/custom_webfont.css"}}"> 当我的ghost

我刚刚用它生成了一个个性化的字体

当我尝试在我的Ghost安装中引用它时,文件总是返回404。以下是我所做的:

  • 我在/content/themes/[theme name]/assets/fonts文件夹中添加了生成字体文件的完整文件夹

  • 我引用default.hbs中的main.css文件

  • 像这样:

    <link rel="stylesheet" type="text/css" href="{{asset "fonts/custom_webfont.css"}}">
    
    当我的ghost安装中的任何页面被正确呈现时,它将在此地址上为CSS提供服务:

    /assets/fonts/custom_webfont.css?v=594627dbc0
    (我假设额外的v号用于缓存)

    但是没有提供字体文件。如果我尝试这些URL中的任何一个,都找不到任何内容:

    http://localhost:2368/assets/fonts/custom_webfont.woff/?v=594627dbc0
    http://localhost:2368/assets/fonts/custom_webfont.woff
    http://localhost:2368/assets/fonts/custom_webfont.eof/?v=594627dbc0
    http://localhost:2368/assets/fonts/custom_webfont.eof
    

    也许我问这个问题迟到了,但值得一试

    我敢肯定你走错了路。试着这样做:

    rel=“stylesheet”type=“text/css”href=“{{asset}}/font/custom_webfont.css”>

    这对我有用

    http://localhost:2368/assets/fonts/custom_webfont.woff/?v=594627dbc0
    http://localhost:2368/assets/fonts/custom_webfont.woff
    http://localhost:2368/assets/fonts/custom_webfont.eof/?v=594627dbc0
    http://localhost:2368/assets/fonts/custom_webfont.eof