Skip to content

Commit

Permalink
Merge branch 'release/1.1.0' into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Welch committed Apr 4, 2020
2 parents 17b0b9f + 534a5ac commit 5234efc
Show file tree
Hide file tree
Showing 12 changed files with 3,085 additions and 1,565 deletions.
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Craft .gitignore
#
# Example .gitignore file for Craft CMS projects
#
# @author nystudio107
# @copyright Copyright (c) 2017 nystudio107
# @link https://nystudio107.com/
# @package craft-scripts
# @since 1.1.0
# @license MIT

# This file should be renamed to '.gitignore' and placed in your
# Craft CMS project root directory

# CRAFT ENVIRONMENT
.env.php
.env.sh
.env

# COMPOSER
/vendor

# BUILD FILES
/bower_components/*
/node_modules/*
/build/*
/yarn-error.log

# MISC FILES
.cache
.DS_Store
.idea
.project
.settings
*.esproj
*.sublime-workspace
*.sublime-project
*.tmproj
*.tmproject
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
config.codekit3
prepros-6.config
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Recipe Changelog

## 1.1.0 - 2020.04.03
### Added
* Added support for imperial pounds and metric kilograms
* Added support for passing in an image transform to `.getImageUrl()`

### Fixed
* Fixed errant display of the 1.66 quantity by rounding the mantissa so we can do a floating point comparison without weirdness, per: https://www.php.net/manual/en/language.types.float.php#113703
* Fix the abbreviations to be be the same whether singular or plural as per [Measurement Abbreviations](https://abbreviations.yourdictionary.com/articles/measurement-abbreviations.html)

## 1.0.11 - 2019.07.10
### Changed
* Add support for 2/3 fraction
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nystudio107/craft-recipe",
"description": "A comprehensive recipe FieldType for Craft CMS that includes metric/imperial conversion, portion calculation, and JSON-LD microdata support",
"type": "craft-plugin",
"version": "1.0.11",
"version": "1.1.0",
"keywords": [
"craft",
"cms",
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
title: 'Recipe Documentation',
description: 'Documentation for the Recipe plugin',
base: '/docs/recipe/',
dest: '../../../../sites/nystudio107/web/docs/recipe',
dest: '../../../sites/nystudio107/web/docs/recipe',
themeConfig: {
sidebar: [
['/', 'Recipe plugin for Craft CMS 3.x'],
Expand Down
32 changes: 31 additions & 1 deletion docs/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,41 @@ To display information about a recipe in your templates, you just use familiar T
* `entry.someRecipe.description` - the description of the recipe
* `entry.someRecipe.skill` - the skill level required to make this recipe
* `entry.someRecipe.serves` - how many people the recipe serves
* `entry.someRecipe.getImageUrl()` - a URL to the image for the recipe
* `entry.someRecipe.getImageUrl()` - a URL to the image for the recipe; you can pass in an optional image transform or image transform handle here as well: `entry.someRecipe.getImageUrl('display')`
* `entry.someRecipe.prepTime` - the prep time for the recipe in minutes
* `entry.someRecipe.cookTime` - the cooking time for the recipe in minutes
* `entry.someRecipe.totalTime` - the total time for the recipe in minutes

### Nutritional Facts

For a nutrition facts label, you can use:

```twig
{{ entry.someRecipe.renderNutritionFacts() }}
```

Which will output a responsive nutrition facts label embed based on the data in the Nutrition tab:

![Screenshot](./resources/screenshots/recipe03.png)

The percentages are based on [US Recommended Dietary Allowances](https://en.wikipedia.org/wiki/Reference_Daily_Intake), but you can pass in your own values as well:

```twig
{{ entry.someRecipe.renderNutritionFacts({
'calories': 2000,
'carbohydrateContent': 275,
'cholesterolContent': 300,
'fatContent': 78,
'fiberContent': 28,
'proteinContent': 50,
'saturatedFatContent': 20,
'sodiumContent': 2300,
'sugarContent': 50,
}) }}
```

If you want to control the way the template looks, you can put your own frontend template in `recipe/recipe-nutrition-facts` and Recipe will use it

### Ingredients

For a list of ingredients, do the following (adding whatever output markup you want):
Expand Down
Binary file added docs/docs/resources/screenshots/recipe03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5234efc

Please sign in to comment.