This content is styled by the decor stylesheet
This content is styled by the page stylesheet
HTMLDecor ========= > HTMLDecor means **full** separation of content from presentation. > With CSS you can change the styling of a whole site with one stylesheet. > With HTMLDecor you can change everything - > banner, navbars, ads, page-layout and stylesheets. > This facilitates API-first / HTML-payload sites which are > simple, robust and low-bandwidth, > plus "pushState assisted navigation" comes for free. HTMLDecor is a Javascript page decoration engine which runs in the browser. It allows your site to deliver real page content first and fast (think API-first with HTML-payloads). Your site decor can be placed in its own page and merged in the browser instead of on the server. Auxiliary content could also be conditionally loaded with AJAX (think inside-out iframes). A site decor page is similar to an external stylesheet in that it can be shared between several pages. Originally it was even referenced with a resource link, just like stylesheets: **(This referencing method has been superceded by external configuration, which is less limiting.)** As a bonus, when your site uses HTMLDecor "pushState assisted navigation" requires no additional setup. When someone viewing your page clicks on a link to another page that uses the same decor then AJAX updates the real content and `history.pushState()` updates the browser URL. HTMLDecor.js is around 10kB when minified and gzipped. To see it in action visit my [blog](http://meekostuff.net/blog/). Make sure you view the page source and check that it is just raw content. The navbar and contact popup are all in the [site-decor page](http://meekostuff.net/blog/decor.html). For more info on the concept of HTMLDecor and its affinity with pushState assisted navigation, read - [The HTML decor concept](http://meekostuff.net/blog/HTML-Decor-I/) - [Introducing HTMLDecor.js](http://meekostuff.net/blog/HTML-Decor-II/) - [pushState was made for HTMLDecor](http://meekostuff.net/blog/pushState-was-made-for-HTMLDecor/) Also make sure you check the [wiki](https://github.com/meekostuff/HTMLDecor/wiki). Installation ------------ 1. Copy or clone the HTMLDecor project files to a directory on your server, say /path/to/HTMLDecor/ 2. Open a browser and navigate to the following page http://your.domain.com/path/to/HTMLDecor/test/normal.html Visually inspect the displayed page for the following possible failures: - boxes with **red** background or borders. - boxes that claim to be styled with colored borders but just have the default border. 3. Source the HTMLDecor boot-script into your pages with this line in the `` of each page `` The boot-script - MUST be in the `` of the page - MUST NOT have `@async` or `@defer` - SHOULD be before any stylesheets - `` or `This fallback content will be removed from the page #mk_content in page Create the decor document (decor.html). This is a normal page of HTML that, when viewed in the browser, will appear as the final page without the page specific content.This content is styled by the decor stylesheetThis content is styled by the page stylesheet#header in decor #mk_main in decorWhen page.html is loaded into the browser, HTMLDecor will merge decor.html into it, following these steps: 1. Set the visibility of the page to "hidden". \* 2. Detect the first ``, fully resolve the @href and use as the decor URL. 3. Load the decor URL into an iframe. 4. Fully resolve URLs for all scripts, images and links in the decor page. 5. Insert `#mk_content in decor: This will be replaced by #mk_content from the page #header in decor #mk_main in decor#mk_content in page This content is styled by the decor stylesheetThis content is styled by the page stylesheet