Adding Multiple Categories in Posts

Posted by : on

Category : jekyll   guides   sample_category


Adding Multiple Categories in Posts

To add categories in blog posts all you have to do is add a category key with category values in frontmatter of the post :

---
category: ['jekyll', 'guides', 'sample_category']
---

Then to render this category using link and pages. All we need to do is,

  1. Create a new file with [your_category_name].md inside categories folder.

  2. Copy categories/sample_category.md file and replace the content in [your_category_name].md in that. (Please don’t copy the code below its just sample, since it renders the jekyll syntax dynamically)

---
layout: page
title: Guides
permalink: /blog/categories/your_category_name/
---

<h5> Posts by Category : Adding Multiple Categories in Posts </h5>

<div class="card">

</div>

Using the category, all the posts associated with the category will be listed on http://localhost:4000/blog/categories/your_category_name


About Fathima Riham MN

Hello!👋I'm Fathima Riham MN, a design-minded front-end software engineer focused on building beautiful interfaces & experiences. I am a highly motivated and ambitious IT professional currently pursuing a Bachelor of Software Engineering (BSE) at the Open University of Sri Lanka, complemented by a High National Diploma in IT from SLIATE. As an IT professional, I bring a strong passion for the Software & IT industry and a commitment to continuous learning and improvement.

Star
Useful Links