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

New principle: How to attach meta-information to a document #506

Open
martinthomson opened this issue Jul 18, 2024 · 4 comments
Open

New principle: How to attach meta-information to a document #506

martinthomson opened this issue Jul 18, 2024 · 4 comments
Assignees
Labels
Status: In Progress We're working on it but ideas not fully formed yet. Topic: HTML Topic: HTTP

Comments

@martinthomson
Copy link
Contributor

There are several ways to attach meta-information to documents. There are some trade-offs to understand for each.

  • data-* attributes (which make information available to script and somewhat to styling)
  • new custom elements (which make information available for presentation and styling, but can also be hidden)
  • meta tags in the header
  • link relations in the header
  • HTTP header (or footer) fields

It might be good to list these out, point out that it is worth seeing if your use case is already addressed by a pre-existing thing for one of these other items, and go through some pros and cons of each.

Related to #213, and which might supersede #213.

@hober
Copy link
Contributor

hober commented Jul 19, 2024

Not just documents, but also origins and sites. That is, this principle should also call out when to or when not to use /.well-known/ URLs, when or when not to add stuff to Web Manifest, and the like.

@annevk
Copy link
Member

annevk commented Aug 21, 2024

Is the audience for this specification authors or web developers? As the former should never touch data-* or custom elements.

@LeaVerou LeaVerou added Status: In Progress We're working on it but ideas not fully formed yet. Topic: HTML Topic: HTTP labels Dec 3, 2024
@LeaVerou
Copy link
Member

LeaVerou commented Dec 3, 2024

This comes up very frequently in web components too: how to convey global settings to WCs without repeating them on every single instance?

Is the audience for this specification authors or web developers? As the former should never touch data-* or custom elements.

Yup, the answer is different, but we should figure out what it is for either case and document it.

@bkardell
Copy link

bkardell commented Dec 3, 2024

I guess there is also <script type="application/ld+json"> which is quite common and (I believe) not covered in the initial bullets of ways its been done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress We're working on it but ideas not fully formed yet. Topic: HTML Topic: HTTP
Projects
None yet
Development

No branches or pull requests

5 participants