-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement template files and page instrospection
BREAKING CHANGE: change the function signature passed to layouts and pages. Before all global, layout, page, and builder vars would get merged into an object, along with the scripts and styles array. Now these user defined variables come in on the same object, but under the key `vars`. See the updated examples to see how this works. Also implements page introspection. Layouts and js pages receive a `page` and `pages` variable. They include a resolved `vars` key that includes the fully resolved variable object for the page. The `pages` variable is similar, but it includes an array of all pages in the site, so that pages and templates can iterate through them to create RSS feeds, or index pages for blogs and what not. The shape of this will probably change soon, but it's there to experiment with. Each page object includes a method to render the inner and full page easily (`renderInnerPage ({ pages })` and `async renderFullPage ({ pages })`. You need to pass a pages instance, though this may also change soon.) Template files let you generate any file while accessing the globalVars object, as well the `pages` array for generate RSS feeds.
- Loading branch information
Showing
35 changed files
with
588 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.