Merged
Conversation
…ted layouts - Add template_name parameter to get_front_matter method signature - Pass both file_path and template_name when calling get_front_matter in _process_template - Ensure nested article layout templates properly extract and apply front matter - Add test to verify article layout front matter hierarchy is respected - Add front matter to blog/subject/layout.jinja test template This fixes an issue where nested layout templates (e.g., articles/blog/subject/layout.jinja) were not having their front matter properly extracted and applied, as the template_name was being derived from file_path instead of being explicitly passed.
Consolidate draft checking to handle multiple truthy value formats (boolean, string, integer) and apply consistently in both template and article page processing.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces improvements to front matter handling in templates, enhances draft article exclusion logic, and adds new tests to ensure correct metadata inheritance from nested layouts. The changes also update the project metadata and test coverage for layout front matter.
Bug fix: Nested template layout frontmatter
/views/articlesinstead of the one correctly mapped to the given markdown file. This was becauseos.path.basenamewas incorrectly being used to get the template name at the last step before retrieving frontmatter, so it would always belayout.jinjainstead ofblog/layout.jinjaorsubject/layout.jinja, etc. This is now resolved by passing the original (correct) template name that was extracted earlier in the process to theget_front_mattermethod.Front matter and draft handling improvements:
TemplateHandler: Articles and templates marked as drafts (via thedraftfield in front matter, supporting multiple representations likeTrue,"true","1", etc.) are now reliably excluded from output. [1] [2]get_front_mattermethod now accepts bothfile_pathandtemplate_nameparameters, improving its ability to extract metadata from both markdown and Jinja templates, especially for nested or included templates.Project metadata and test coverage:
0.0.1a3inpyproject.toml.layout.jinjafor more explicit metadata inheritance in nested articles.authorandbody_id) from their nested layout templates, ensuring metadata is properly reflected in the generated HTML.