Skip to content

Commit

Permalink
Merge branch 'release/1.3.0' into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Welch committed Mar 5, 2021
2 parents 9818238 + e21e8ae commit cee1bdb
Show file tree
Hide file tree
Showing 20 changed files with 1,900 additions and 1,100 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Recipe Changelog

## 1.3.0 - 2021.03.05
### Added
* Added the ability to fetch nutritional information from ingredients using the [Edamam Nutrition Analysis API](https://developer.edamam.com/edamam-nutrition-api).
* Added plugin settings for configuring API credentials.
* Added a console controller action that generates nutritional information for all entries in a section using the API.
* Added docs buildchain

## 1.2.1 - 2021.01.28
### Added
* Added sodium content to nutrition facts template.
Expand All @@ -16,7 +23,7 @@

## 1.1.3 - 2020.05.25
### Fixed
* Add plural for grams and remove cups abreviation
* Add plural for grams and remove cups abbreviation
* Correct prefix of 0 for measurements and use 'cups' instead of c

## 1.1.2 - 2020.04.16
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ARG TAG=12-alpine
FROM nystudio107/node-dev-base:$TAG

WORKDIR /app/buildchain/

CMD ["run build"]

ENTRYPOINT ["npm"]
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
TAG?=12-alpine
CONTAINER?=recipe-buildchain
DEST?=../../sites/nystudio107/web/docs/recipe

.PHONY: docs install npm

docker:
docker build \
. \
-t nystudio107/${CONTAINER}:${TAG} \
--build-arg TAG=${TAG} \
--no-cache
docs:
docker container run \
--name ${CONTAINER} \
--rm \
-t \
-v `pwd`:/app \
nystudio107/${CONTAINER}:${TAG} \
run docs
rm -rf ${DEST}
mv ./docs/docs/.vuepress/dist ${DEST}
36 changes: 36 additions & 0 deletions buildchain/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"author": {
"email": "[email protected]",
"name": "Andrew Welch",
"url": "https://nystudio107.com"
},
"browser": "./src/Recipe.php",
"bugs": {
"email": "[email protected]",
"url": "https://nystudio107.com"
},
"dependencies": {
},
"description": "A comprehensive recipe FieldType for Craft CMS that includes metric/imperial conversion, portion calculation, and JSON-LD microdata support",
"devDependencies": {
},
"homepage": "https://nystudio107.com",
"keywords": [
"recipe",
"craftcms",
"craft",
"cms",
"plugin"
],
"license": "SEE LICENSE IN LICENSE.md",
"name": "recipe",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/nystudio107/craft-recipe.git"
},
"scripts": {
"docs": "cd ../docs && rm -f package-lock.json && npm install && npm run docs:build"
},
"version": "1.3.0"
}
4 changes: 2 additions & 2 deletions 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.2.1",
"version": "1.3.0",
"keywords": [
"craft",
"cms",
Expand Down Expand Up @@ -33,7 +33,7 @@
"name": "Recipe",
"handle": "recipe",
"schemaVersion": "1.0.0",
"hasCpSettings": false,
"hasCpSettings": true,
"hasCpSection": false,
"changelogUrl": "https://raw.githubusercontent.com/nystudio107/craft-recipe/v1/CHANGELOG.md",
"class": "nystudio107\\recipe\\Recipe"
Expand Down
1 change: 0 additions & 1 deletion docs/docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module.exports = {
title: 'Recipe Documentation',
description: 'Documentation for the Recipe plugin',
base: '/docs/recipe/',
dest: '../../../sites/nystudio107/web/docs/recipe',
themeConfig: {
sidebar: [
['/', 'Recipe plugin for Craft CMS 3.x'],
Expand Down
21 changes: 18 additions & 3 deletions docs/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Recipe works on Craft 3.x.

Recipe adds a 'Recipe' FieldType for Craft CMS that you can add to any of your Sections.

It encapsulates everything you need for a recipe, including the ingredients, a photo of the recipe, directions, cooking time, ratings, and even nutritional information. It handles converting between Imperial and Metric units, outputs 'pretty' fractions for Imperial units, and can output correct ingredient portions for any number of servings.
In encapsulates everything you need for a recipe, including the ingredients, a photo of the recipe, directions, cooking time, ratings, and even nutritional information. It handles converting between Imperial and Metric units, outputs 'pretty' fractions for Imperial units, and can output correct ingredient portions for any number of servings.

Recipe also generates the [JSON-LD microdata](https://developers.google.com/structured-data/) for your recipes, which allows it to be displayed in the [Google knowledge panel](https://developers.google.com/structured-data/rich-snippets/recipes) for search results.

Expand Down Expand Up @@ -203,7 +203,7 @@ Recipes can be imported using the first-party [Feed Me](https://plugins.craftcms
<Row>
<Rating>3</Rating>
<Review>It's just dough.</Review>
<Author>Alanis</Author>
<Author>Alice</Author>
</Row>
</Reviews>
</Recipe>
Expand Down Expand Up @@ -247,11 +247,26 @@ Recipes can be imported using the first-party [Feed Me](https://plugins.craftcms
{
"Rating": 3,
"Review": "It's just dough.",
"Author": "Alanis"
"Author": "Alice"
}
]
}
}
```

## Fetching Nutritional Information from an API

Nutritional information for recipe ingredients can be fetched in the Nutrition tab using the [Edamam Nutrition Analysis API](https://developer.edamam.com/edamam-nutrition-api). You must first get an API application ID and key and enter them in the plugin settings. A `Fetch Nutritional Information` button will then appear in the `Nutrition` tab of the recipe field.

![Screenshot](./resources/screenshots/recipe-api.png)

A console command to generate nutritional information from the API for all entries in a specific section is also available.

```sh
./craft recipe/nutrition-api/generate --section=recipes --field=recipe
```

Both the `section` (section handle) and `field` (recipe field handle) options are required. Note that this command will overwrite the nutritional information for _every_ entry in the given section.


Brought to you by [nystudio107](https://nystudio107.com)
Binary file added docs/docs/resources/screenshots/recipe-api.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 cee1bdb

Please sign in to comment.