Skip to content

RFC: Support slot attributes and data cascade #16

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

Open
giuseppeg opened this issue Feb 19, 2021 · 0 comments
Open

RFC: Support slot attributes and data cascade #16

giuseppeg opened this issue Feb 19, 2021 · 0 comments
Labels
help wanted Extra attention is needed RFC request for comments

Comments

@giuseppeg
Copy link
Owner

giuseppeg commented Feb 19, 2021

⚠️ this feature is related to the Collections proposal and probably should be implemented before #17.

slot attributes

Currently xm support only element slots:

<slot name="title"></slot>

We should add support for slot attributes:

<a slot:href="https://{domain}/contact">contact me</a>

These will be filled with fill elements eg:

<fill name="domain">acme.com</fill>

spec

Any attribute can be slotted if prefixed with slot:. Within the value for the attribute there can be multiple expressions delimited with { and }. The expression name matches a fill name, and xm replaces the expression with the fill value.

Data Cascade

xm should allow to define multiple sources for data, including a global data object that is provided via config file.

We need to rework the main plugin to merge the data correctly using a Data Cascade mechanism similar to the 11ty's one. Check out https://www.11ty.dev/docs/data-cascade/

Additionally we need to provide a global xm:permalink fill value that contains the absolute path for the file so that people can use it to reference to the current page (eg. when creating sharing links). The xm: namespace will be reserved for xm fill values.

@giuseppeg giuseppeg added the help wanted Extra attention is needed label Feb 19, 2021
@giuseppeg giuseppeg changed the title Support slot attributes and data cascade RFC: Support slot attributes and data cascade Feb 19, 2021
@giuseppeg giuseppeg added the RFC request for comments label Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed RFC request for comments
Projects
None yet
Development

No branches or pull requests

1 participant