How do I post old html posts to my gh pages on the internet?

I am writing a blog post and want my readers to see some old commits (html) in my gh-pages branch.

In my blog post, I want to say this is how the code looked in the browser when this commit.

For example, this is one of the old commits that I want to show: as an html page that someone can view in their browser how HTML will look in the browser; I don't want to just show them this page on github because the code for this old commit is broken and wants the reader to see the error that the browser console provided.

I am thinking of something like: skorasaurus.github.io/reponame/commithash/index.html?

Does it exist?

+3


source to share


1 answer


If you click the View button in the file index.html

listed at https://github.com/skorasaurus/dtparking/commit/945fae4e059fb12090a8dc22c6cd22e665ebeea2 you will get the exact link for that file:

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

Then you can use the service from htmlpreview.github.io

to render that specific version:

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

(console browser, including: Error: Map container is already initialized.

)



See other alternatives at " Can I run HTML files directly from GitHub instead of viewing their source? "


Then you can try to embed that rendered page in your source gh-branch

. For example ( How to insert 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>

      

(replace example.com with the full htmlpreview url above)

+3


source







All Articles