chowdown icon indicating copy to clipboard operation
chowdown copied to clipboard

Info tags

Open rathgar opened this issue 5 years ago • 3 comments

Adds various tag information supported by Recipe Schema.

Schema elements added are:

  • recipeCuisine: The cuisine of the recipe (for example, French or Ethiopian).
  • suitableForDiet: Indicates a dietary restriction or guideline for which this recipe or menu item is suitable, e.g. diabetic, halal etc.
  • recipeCategory: The category of the recipe—for example, appetizer, entree, etc.
  • keywords: Keywords or tags used to describe this content.

These correspond to recipe front matter as:

---
layout: recipe
title: Best Nosh Evah
cuisines: [Mediterranean,French]
diets: [Vegetarian,LowCalorie,GlutenFree]
categories: [Snack,Lunch]
tags: [anything,else,relevant]
---

Thanks to the work by @MichaelThomasMPT tags are already searchable. This PR builds on that and integrates them with other recipe meta data.

This offers a way to display the information. While it does allow users to search by the terms it still isn't possible to navigate to say, all 'Vegetarian' recipes. Although I do know @clarklab has got plans in this direction with the Books feature. Perhaps the tag labels could link to these books?

I have deliberately conflated recipeCategory with category as they seemed semantically equivalent. If there are plans to use this differently, they could be separated.

Appearance

Appears below the introduction, above the recipe detail:

Mobile Screenshot 2020-02-24 at 12 21 19

Desktop Screenshot 2020-02-24 at 12 23 12

rathgar avatar Feb 24 '20 12:02 rathgar

Now up-to-date with the latest head

rathgar avatar Feb 26 '20 10:02 rathgar

The dietary tags in recipes now link to relevant pages listing all related recipes.

Screenshot 2020-04-22 at 14 26 30

The blocks collapse into once column on mobile:

Screenshot 2020-04-22 at 15 05 40

Hope this is useful 🤞

rathgar avatar Apr 22 '20 14:04 rathgar

I just had an idea that might improve the semantics of the category metadata. In the Recipe schema the recipeCategory is used to signify a course so I wondered if it might be clearer to use the term course instead and leave the Jekyll category unpolluted for something else?

This would result in a clearer markup in the front matter:

courses: [lunch,dinner,snack]

Does that sound better?

rathgar avatar May 09 '20 14:05 rathgar