KEMBAR78
Fix rendering non-false value sections by roblillack · Pull Request #55 · cbroglie/mustache · GitHub
Skip to content

Conversation

roblillack
Copy link

This fixes rendering sections not backed by a slice, map or struct, but not false either.

According to the spec, this should work, so I fixed it and added a small test.

Sidenote: I think this should have been caught in spec_test.go, but for some reason this test is not part of the tested .json files (it is part of the .yaml files in mustache/spec, though).

@codecov-commenter
Copy link

codecov-commenter commented Jun 9, 2021

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.77%. Comparing base (f01d98a) to head (10eb828).
Report is 28 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #55      +/-   ##
==========================================
+ Coverage   84.31%   84.77%   +0.45%     
==========================================
  Files           2        2              
  Lines         440      440              
==========================================
+ Hits          371      373       +2     
+ Misses         46       44       -2     
  Partials       23       23              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cbroglie
Copy link
Owner

cbroglie commented Jun 9, 2021

Thanks for pointing this out @roblillack. I updated to the latest spec tests in #56, which identified some problems. I believe if you rebase that change you should be able to remove the disabled tests in sections.json and have the tests still pass, do you mind doing so?

@roblillack
Copy link
Author

@cbroglie: Yep, that's looking good!

@cbroglie
Copy link
Owner

Awesome, thank you

@cbroglie cbroglie merged commit 1fb86e2 into cbroglie:master Jun 10, 2021
roblillack added a commit to roblillack/tack that referenced this pull request 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants