In Sass we can combine multiple partials into single css output like
@import "scss/header";
@import "scss/footer";
@import "scss/navigation";
@import "scss/sidebar";
into
final.scss > final.css
Is there any method to do same with raw .HTML files (not .php or .asp) like
@import "header.html";
@import "scss/footer.html";
@import "scss/navigation.html";
@import "scss/sidebar.html";
into index.html
The above is just an example to explain, what I’m asking
I know I can do this using php includes but i want to know if i can with just .html files. I just want to combines files at my PC not on server.
It’s not possible in pure HTML.
To do it on the client side, you would have to use Ajax hackery with JavaScript to pull the files into the DOM, which I imagine would be pretty slow and error-prone. I don’t think anybody seriously does that. There are also iframes, obviously, but again for most use cases this would be unsatisfactory.
Since you tagged your question with “rubygems”: If you are using Rails, you can use partials on the server side for this purpose.