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

Page variables not available as {{.}} inside value sections #23

Closed
roblillack opened this issue Jun 10, 2021 · 1 comment
Closed

Page variables not available as {{.}} inside value sections #23

roblillack opened this issue Jun 10, 2021 · 1 comment
Labels
Milestone

Comments

@roblillack
Copy link
Owner

Given a page variable title defined in a metadata file default.yml:

title: This is a test

The variable will not be available in the template default.mustache like this:

{{#title}}<h1>{{.}}</h1>{{/title}}

and an empty string is rendered instead.

Workaround: One can resort to using:

{{#title}}<h1>{{title}}</h1>{{/title}}
@roblillack
Copy link
Owner Author

Have PR open for this upstream: cbroglie/mustache#55

roblillack added a commit that referenced this issue Jun 10, 2021
This adds a bunch of fully integrated test sites.

While here, fix some bugs:
- Fix not being able to read `.md` or `.yaml` files instead of `.mkd` and `.yml`. #22
- Fix title casing. #3 
- Fix iterate `siblings` in correct order. #4
- Fix crash for non-existent asset directories. #5 
- Fix rendering section context. #8 (Needs cbroglie/mustache#54)
- Fix rendering non-false value sections. #23 (Needs cbroglie/mustache#55)

Also, add these features:
- Allow the root index page to be defined with metadata and markup directly in `content/`. #19
- Add support for empty pages (no metadata or markup defined) if they have non-empty children. #20
- Add support for `children` to iterate non-floating child pages. #16
- Add support for `posts` to iterate all child pages marked with a date. #18
- Add support for `menu` sections to iterate all `siblings` and the current page (only for non-floating pages). #17
- For each entry of page collections (`children`, `menu`, `navigation`, `posts`, `siblings`) add `first` and `last` boolean values that can be used to construct better separators. #21
@roblillack roblillack added this to the v1.1.0 milestone Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant