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

provide JavaScript Layout Templates' data and permalink class members with some useful info #1082

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Apr 8, 2020

  1. provide JavaScript Layout Templates' data class member with some us…

    …eful info: the inputPath (template), the invoking template instance and the current engine instance. Relevant documentation which drove this change: https://www.11ty.dev/docs/languages/javascript/#permalink-function -- without the change, the `permalink` member in a `_data/layouts/layout.js` layout template will fail when it's made a function like the documentation says it can.
    
    Extra are the extra parameters passed into such a class' `data` member function: template and engine. For that, a few other classes needed to have their APIs changed as well.
    
    The meat for making the `permalink` member work as a member function type is in src/Template.js, while the meat for the `data` member function is in src/Engines/JavaScript.js (the `inst.data(...)` call in there).
    GerHobbelt committed Apr 8, 2020
    Configuration menu
    Copy the full SHA
    28d32d5 View commit details
    Browse the repository at this point in the history