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

Added Categories Support for Posts #291

Closed
wants to merge 3 commits into from
Closed

Added Categories Support for Posts #291

wants to merge 3 commits into from

Conversation

manikmagar
Copy link
Member

Implemented Categories Support for Posts.

Categories configuration controls -

  • template.category.file=category.ftl (This is for rendering individual category page)
  • template.categories.file=categories.ftl (This is for rendering all categories list page to prevent directory listing on {site.host}/categories/ url.
  • categories.enable=true
  • render.categories=true
  • category.default=Uncategorized
  • categories.path=categories
  • categories.sanitize=false

Adding categories in content

Add an attribute categories=Category1, Category2

  • If categories.enable is not false and no categories are provided for post then category.default is applied to post.
  • First category is also available with primary_category key in model.
  • If categories.enable is false and categories are still provided in content, then those are ignored with a warning in log.

Accessing categories in templates

  • all_categories - All categories from all published content. This variable is available on templates.
  • category_posts - On a single category page template.category.file, this variable is available and provides access to posts marked with category being displayed on page.

Test cases

Appropriate test cases have been added under src/test/java with its resources under src/test/resources.

@manikmagar
Copy link
Member Author

This should close Categories part from #284.

@coveralls
Copy link

coveralls commented Jun 21, 2016

Coverage Status

Coverage increased (+0.9%) to 66.071% when pulling 1d78951 on manikmagar:master into 90b8375 on jbake-org:master.

@manikmagar
Copy link
Member Author

@jonbullock please check this.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.1%) to 66.112% when pulling a41569c on manikmagar:master into 07dd157 on jbake-org:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+1.1%) to 66.112% when pulling a41569c on manikmagar:master into 07dd157 on jbake-org:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.1%) to 66.112% when pulling a41569c on manikmagar:master into 07dd157 on jbake-org:master.

@manikmagar
Copy link
Member Author

Something went wrong with my forked repo. I will submit a fresh pull request. DO NOT merge this one.

@manikmagar manikmagar closed this Jun 24, 2016
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.

2 participants