【问题标题】:How can I publish old html commits in my gh-pages branch online?如何在线发布我的 gh-pages 分支中的旧 html 提交?
【发布时间】:2014-10-17 10:06:36
【问题描述】:

我正在写一篇博文,并希望我的读者在我的 gh-pages 分支中看到几个旧的提交(html)。

在我的博文中,我想说,这是代码在浏览器中的样子,在这次提交中。

For example, this is one of the old commits that I want to show: 作为一个 html 页面,人们可以在他们的浏览器中查看,就像 HTML 在浏览器中一样;我不想只向他们展示 github 上的原始页面,因为旧提交上的代码已损坏,并希望读者看到浏览器控制台会给出的错误。

我在想类似的东西:skorasaurus.github.io/reponame/commithash/index.html?

这存在吗?

【问题讨论】:

    标签: github github-pages


    【解决方案1】:

    如果您单击https://github.com/skorasaurus/dtparking/commit/945fae4e059fb12090a8dc22c6cd22e665ebeea2 上列出的index.html 文件的“查看”按钮,您将获得该文件的确切参考:

    https://github.com/skorasaurus/dtparking/blob/945fae4e059fb12090a8dc22c6cd22e665ebeea2/index.html

    然后您可以使用来自htmlpreview.github.io 的服务来可视化该特定版本:

    http://htmlpreview.github.io/?https://github.com/skorasaurus/dtparking/blob/945fae4e059fb12090a8dc22c6cd22e665ebeea2/index.html

    (与浏览器的控制台包括:Error: Map container is already initialized.)

    在“Can I run HTML files directly from GitHub, instead of just viewing their source?”查看其他替代方案。


    然后您可以尝试将该呈现的页面嵌入到您的gh-branch 源中。例如 (How to embed a “live” web page in WordPress blog posts)

    <object data=http://www.example.com width=”650″ height=”500″> 
       <embed src=http://www.example.com width=”650″ height=”500″ />
    </object>
    

    (将 example.com 替换为上面的完整 htmlpreview url)

    【讨论】:

      猜你喜欢
      • 2017-11-04
      • 2011-06-12
      • 1970-01-01
      • 2015-12-13
      • 2019-09-16
      • 2014-09-07
      • 2014-12-16
      • 2021-08-01
      • 2018-02-02
      相关资源
      最近更新 更多