w3c / html

Deliverables of the HTML Working Group until October 2018

Home Page:https://w3c.github.io/html/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<include> tag needed for HTML content

greg-raven opened this issue · comments

It seems odd to me that you can include style sheets, images, audio, video, and other content that resides in external files into an HTML document, but not HTML from an external file, at least, not without resorting to SSI, PHP, JavaScript, etc., each of which has drawbacks. How difficult would it be to add an tag to the HTML specification that would allow repetitive content (headers, footers, navigation, etc.) to appear in one HTML file but be called by other HTML files? With the growing adoption of HTTP/2 and various caching capabilities from the browser on up the delivery chain, this approach would make site maintenance much easier, reduce page sizes, and improve load times.

commented

I'm not sure if got your suggestion correctly, but it sounded a little like HTML Imports API, that was used by Polymer 1 and early Polymer 2 versions.
https://polymer-library.polymer-project.org/1.0/docs/devguide/registering-elements

Here's the specification.
https://www.w3.org/TR/html-imports/

Although HTML Import is getting deprecated, here's a blog post from Polymer's community https://www.polymer-project.org/blog/2017-10-18-upcoming-changes

Here's Chrome status about the deprecation
https://www.chromestatus.com/feature/5144752345317376

Internet is moving towards SPA applications, an so, frameworks are adapting to handle JavaScript more effectively making html dynamically through web components

There's been a quite extensive discussion about client-side includes over at whatwg/html#2791

Client-side includes are one thing, but they do not equal the ease and functionality of server-side includes. Compare SSI includes or PHP includes, which deliver a complete page to the visitor, to Ajax or React or Vue or whatever, and there's no comparison. And now, with the rising popularity of hosts such as Netlify, SSI and PHP includes are not an option, so we need a native, built-in, simple-to-implement, HTML include.

Thanks all.

We're closing this issue on the W3C HTML specification because the W3C and WHATWG are now working together on HTML, and all issues are being discussed on the WHATWG repository.

If you filed this issue and you still think it is relevant, please open a new issue on the WHATWG repository and reference this issue (if there is useful information here). Before you open a new issue, please check for existing issues on the WHATWG repository to avoid duplication.

If you have questions about this, please open an issue on the W3C HTML WG repository or send an email to public-html@w3.org.