【问题标题】:How to import html file into markdown with GatsbyJS如何使用 GatsbyJS 将 html 文件导入 markdown
【发布时间】:2020-05-19 05:30:35
【问题描述】:

我正在创建一个 gatsby 网站,其中包含从 markdown 生成的页面。目前,每个降价文件都在一个单独的目录中。该目录中还有一个.html 文件。有没有办法可以在markdown中使用该html文件,而不是作为代码sn-p,而是作为实际的html?

例如,如果我的降价文件是:

This is markdown

import:bar.html

bar.html 是:

<div>This is html</div>

输出将是:

<p>This is markdown</p>
<div>This is html</div>

【问题讨论】:

    标签: javascript reactjs gatsby


    【解决方案1】:

    我通过使用 iframe 并编写了一个本地插件来解决这个问题,该插件将 iframe 指定的 html 文件移动到公共文件夹,允许 iframe 呈现它。

    【讨论】:

      猜你喜欢
      • 2022-01-02
      • 1970-01-01
      • 2023-03-03
      • 2022-11-19
      • 2020-12-19
      • 1970-01-01
      • 2019-06-28
      • 1970-01-01
      • 2020-07-01
      相关资源
      最近更新 更多