Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arbitrary HTML asset aggregation #36

Open
zachleat opened this issue Oct 7, 2022 · 1 comment
Open

Arbitrary HTML asset aggregation #36

zachleat opened this issue Oct 7, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@zachleat
Copy link
Member

zachleat commented Oct 7, 2022

We already have CSS/JS asset aggregation. I’d like to see this with arbitrary HTML too. Think of a single WebC component file for a web font that includes both the @font-face CSS and the preload HTML together! Or a WebC icon that only includes a single <g> that aggregates up to a reusable de-duplicated SVG icon set.

<style webc:bucket="priority">
@font-face {
  src: url("font.woff2") format("woff2");
}
</style>

<template webc:bucket="header">
  <link rel="preload" href="font.woff2" as="font" type="font/woff2" crossorigin>
</template>
<template webc:bucket="svg-icon">
  <g id="icon-arrow”>
    <path d="…"></path>
  </g>
</template>
@zachleat zachleat added the enhancement New feature or request label Oct 7, 2022
@zachleat
Copy link
Member Author

The bundle plugin has this functionality: https://github.com/11ty/eleventy-plugin-bundle (it needs to be wired up to WebC though)

see also 11ty/eleventy-plugin-webc#48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant