0

I'm currently building a website using the service provided by github with gh-pages.

Since it is possible to download the repository as a zip package, i'm trying to figure out a good way to include header, footer and other stuff into the different pages I'm about to write for an offline browsing supported by at least the more common browsers such us chrome, safari and firefox.

The website builded this way should be rendered only by the browser, so php, ssi etc don't fit the need.

Jquery seems to be a good way (of course given that i provide the needed scripts in the repo to download), but i am having some issues with chrome which encounter a permission denied error handling a localhost file retrivial.

So in which smart way can i include an HTML file into another one?

2
  • I think an ajax method could work as explained here dynamicdrive.com/dynamicindex17/ajaxincludes.htm however the simple jquery $(#id).load(file) was more straightforward. Commented Apr 23, 2015 at 6:53
  • After further research I found this net script johannburkard.de/blog/programming/javascript/… which works like a charm, however the nested menu included in such way isn't modified by another jquery script that handles hide\show css function. Why? Commented Apr 23, 2015 at 12:53

2 Answers 2

0

I'm sure you will be pleased by Jekyll static site generator

Sign up to request clarification or add additional context in comments.

4 Comments

That's not a viable way, because if all the files are downloaded locally the website will not be rendered just using a browser to open index.html. A local install of jekyll would be needed. And what I aim to do is a downloadable website which is usable offline just with a browser. Thanks anyway for the hint even if I already knew jekyll and it's setup.
And Jekyll, the Octopress way. Generate locally, automatically push code in one branch, generated website in an other. Just do a release on github and your generated website can be downloaded as a zip and fully functional on a file system. octopress.org
I'll read more about octopress, thanks! However how could a browser interpret liquid formatting and YAML code on it's own?
With octopress you have the code in one branch and the generated result in one other, all come from you local build. You customer only have to download the generated result and it will play nearly well offline, because of the resources path that can be tricky to setup.
0

This may possibly help. HTML5 is starting to support offline pages/applications.

See http://updates.html5rocks.com/2015/02/offline-first-with-sw-precache

and http://googlechrome.github.io/sw-precache/

This is currently only available in Chrome Canary and Firefox nightly but offline support is becoming a standard in w3c. See http://www.w3.org/TR/service-workers/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.