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

Info tags #31

Open
wants to merge 17 commits into
base: gh-pages
Choose a base branch
from
Open

Info tags #31

wants to merge 17 commits into from

Conversation

rathgar
Copy link
Contributor

@rathgar rathgar commented Feb 24, 2020

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

use basscss utility classes and try to match the nutrition
use basscss utility classes and try to match the nutrition
# Conflicts:
#	_includes/nutritional-information.html
#	_layouts/recipe.html
#	css/main.scss
@rathgar
Copy link
Contributor Author

rathgar commented Feb 26, 2020

Now up-to-date with the latest head

@rathgar rathgar marked this pull request as ready for review February 26, 2020 10:48
rathgar added 4 commits April 22, 2020 08:55
Include links to relevant index pages
improve top links
remove unnecessary logic
@rathgar
Copy link
Contributor Author

rathgar commented Apr 22, 2020

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 🤞

Display a message instead of a blank page.
@rathgar
Copy link
Contributor Author

rathgar commented May 9, 2020

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 and others added 6 commits November 9, 2020 20:11
now work when pre-built to html
leaves the spacial jeckyll category attribute for something else
Wrong var in course
No need to capitalise course name in code
Not necessary to capitalise the displayed tag.
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.

1 participant