【问题标题】:how to embed github file to a github pages blog post如何将 github 文件嵌入到 github 页面博客文章中
【发布时间】:2016-10-01 19:09:49
【问题描述】:

我正在使用 github pages 和 jekyll 创建一个博客。我想知道是否有办法在博客文章中嵌入来自 github file 的代码 sn-ps(即 repo 中的文件)。我可以在此页面上找到有关嵌入要点的解决方案:https://gist.github.com/benbalter/5555251

不过,对于 github 文件没有直接的解决方案。

【问题讨论】:

标签: github jekyll r-markdown


【解决方案1】:

Jekyll 有一个非常漂亮的语法高亮系统(提供 _sass/sytax-highlighting.scss 存在且正确),因此可以将代码复制到博客文章中,使用 `s 来包装代码。

根据 Github 存储库中的实际 嵌入,有一个非常漂亮的项目 here,如果您想查看它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-23
    • 1970-01-01
    • 1970-01-01
    • 2020-03-24
    • 2022-12-25
    • 2015-04-08
    相关资源
    最近更新 更多