11ty / eleventy

A simpler site generator. Transforms a directory of templates (of varying types) into HTML.
https://www.11ty.dev/
MIT License
17.31k stars 495 forks source link

Normalize signature of `this` in callbacks that operate on templates #1522

Closed zachleat closed 1 year ago

zachleat commented 4 years ago

Thinking https://www.11ty.dev/docs/config/#transforms and linters and before callback in Pagination (#1209).

This will be important before 1.0 release to avoid any breaking changes.

I’d like the metadata available in this to be consistent here. Specifically this.page.inputPath instead of this.inputPath. See https://www.11ty.dev/docs/data-eleventy-supplied/

There are likely others—I don’t have time to compile them all here right this second but we’ll need to look through and find them all.

zachleat commented 3 years ago

Related to https://github.com/11ty/eleventy/issues/338 (and https://github.com/11ty/eleventy/issues/130)

There are two styles in play here:

Collection-style:

Template-style:


ACTION ITEMS

zachleat commented 3 years ago

After this last analysis I don’t think this is a blocker for 1.0. Moving it out of the milestone.

zachleat commented 1 year ago

Filters/helpers shipped with #2250

zachleat commented 1 year ago

this.page is available on Shortcodes, Filters, Linters, Transforms in 2.0.0-canary.19 and newer

zachleat commented 1 year ago

page and content (aliased to templateContent) is available on Collections items on 2.0.0-canary.19 and newer. https://www.11ty.dev/docs/collections/#collection-item-data-structure

nhoizey commented 1 year ago

Time to move to the 2.x branch I guess!

zachleat commented 1 year ago

Cross linking the shortcode work that shipped with v0.11.0 #741