From 6786970c96b98a8faf768d8a9dcebe800da2be8c Mon Sep 17 00:00:00 2001 From: steelman Date: Wed, 28 Mar 2018 23:45:21 +0200 Subject: [PATCH] Docs: describe difference between tags and categories (#6882) Merge pull request 6882 --- docs/_docs/posts.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/_docs/posts.md b/docs/_docs/posts.md index 31821a45..5894d317 100644 --- a/docs/_docs/posts.md +++ b/docs/_docs/posts.md @@ -201,8 +201,32 @@ category: blog In this case, the listing pages will be accessible at `{baseurl}/category/blog.html` -While this example is done with categories, you can easily extend your lists to -filter by tags or any other variable created with extensions. +Although categories and tags are very similar, they are used to group posts, +there are a few differences between them. Categories and sub-categories create +hierarchies that, by default, are reflected in the directory structure of your +site. A post with the following header +```yaml +--- +layout: post +title: A Trip +category: [ blog, travel ] +--- +``` +will be accessible at `{baseurl}/blog/travel/year/month/day/A-Trip.html`. On +the other hand, a tagged post +```yaml +--- +layout: post +title: A Trip +tags: [ blog, travel ] +--- +``` +will be saved as `{baseurl}/year/month/day/A-Trip.html`. It is up to you to +create `{baseurl}/tag/blog.html` and `{baseurl}/tag/blog.html` the same way as +described above for categories. + +While this example is done with tags and categories, you can easily extend your +lists to filter by any other variable created with extensions. ## Post excerpts