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

Doesn't work well with metadata #16

Open
c-sattler opened this issue Nov 29, 2023 · 9 comments
Open

Doesn't work well with metadata #16

c-sattler opened this issue Nov 29, 2023 · 9 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@c-sattler
Copy link

I'm using the Recipe Grabber plugin on Obsidian to pull in recipes from the web. When I try to display them in Recipe View I get a blank view. If I delete the metadata section that Recipe Grabber puts at the front of each note it seems to work fine. Could you modify your plugin to ignore a section of metadata (anything between lines containing "---") at the top of the recipe note file?

@lachholden
Copy link
Owner

Could you please post an example of the properties that don't display properly? I do need to update the property-handling code for #15 too.

@lachholden lachholden added the bug Something isn't working label Dec 1, 2023
@lachholden lachholden self-assigned this Dec 1, 2023
@c-sattler
Copy link
Author

Below is a recipe note created by Recipe Grabber. Note that all of the keys of the key/value pairs have a single ":". I found that if I change these to "::" (Double colons) recipe view works fine. The key/value pairs are displayed properly beneath the recipe title and next to the picture. I'm not sure about #15, the key/value pairs (properties) seem to work consistently once I changed the colons to double colons. Recipe Grabber contains a template of the recipe note in its settings so I was able to change the colons in the temple to double colons and new recipes that are grabbed work with Recipe View. You can consider my issue as resolved.

Almond Cookies

tags: recipe, cookie, glutin free
type: recipe
created: 2023-08-31T16:58:29.607-04:00
author:
url: https://www.bonappetit.com/recipe/almond-cookies

Almond Cookies

(https://www.bonappetit.com/recipe/almond-cookies)

Naturally gluten- and dairy-free, this easy recipe for flourless almond cookies has a hint of rose water. Make them for Passover, New Year’s Eve, or anytime.

Almond Cookies

Ingredients

  • 2 cups (192 g) almond flour
  • ½ tsp. Diamond Crystal or ¼ tsp. Morton kosher salt
  • ½ tsp. ground cinnamon or cardamom (optional)
  • 2 large egg whites
  • 1 cup (200 g) sugar
  • 1 Tbsp. rose water, plus more for hands
  • 24 raw almonds

Instructions

  • Place racks in upper and lower thirds of oven; preheat oven to 350°. Whisk 2 cups almond flour, ½ tsp. Diamond Crystal or ¼ tsp. Morton kosher salt, and ½ tsp. ground cinnamon or cardamom (if using) in a medium bowl to combine.
  • Whisk 2 large egg whites, 1 cup (200 g) sugar, and 1 Tbsp. rose water in a large bowl just until foamy (don’t get carried away; you’re not making meringue). Fold almond flour mixture into wet ingredients with a rubber spatula until incorporated.
  • Add a few drops of rose water to a small bowl of room temperature water; dip hands in bowl to moisten (this allows you to make pretty round cookies and not a sticky mess, while also fortifying the cookies with a little more rosiness). Scoop out tablespoonfuls of dough and form into balls between your hands, moistening your hands with more rose water mixture as needed. Transfer to 2 parchment-paper-lined baking sheets as you work, spacing 2" apart. Gently press 1 almond (from 24 raw almonds) into top of each cookie.
  • Bake cookies, rotating baking sheets top to bottom and front to back halfway through, until spread out and edges are golden, about 15 minutes. Let cool on baking sheets.

Notes

@Merrit
Copy link

Merrit commented Jan 4, 2024

Having the same issue. Here's my example of a recipe I just pulled in that displays blank:

---
tags: recipe 
url: https://forksandfoliage.com/easiest-toum-garlic-dip/ 
---

Creamy, fluffy, and super garlicky - toum is the flavor bomb missing in your kitchen. Pair it with grilled chicken, roasted veggies, and french fries. This recipe comes together in just a few minutes and you don't need a food processor - it's the absolute easiest!

![Easiest Toum Ever (Lebanese Garlic Dip)](https://forksandfoliage.com/wp-content/uploads/2022/04/Toum-Spread-in-Lebanese-Bowl-2-1.jpg)

## Ingredients

- 1 cup garlic cloves (peeled)
- 1 teaspoon kosher salt
- 1/4 cup lemon juice
- 2 cups neutral oil (such as avocado, canola, or grapeseed)

## Directions

- Peel the garlic cloves and place them in a wide mouth quart jar or similar sized container, then add the salt and lemon juice.
- Using an immersion blender, blend the mixture until it resembles a paste.
- Add all the oil on top of the mixture, then the place immersion blender at the very bottom. Start blending without raising it up. As the mixture emulsifies, gradually raise the blender until the whole mixture is white and fluffy.
- Place a lid on the jar and chill in the fridge, ideally overnight, for best flavor.

-----

## Notes

@jane-t
Copy link

jane-t commented Jan 4, 2024

A related problem. I normally use a template with some blank properties, if any are left blank the whole page disappears in recipe view, deleting the empty properties seems to fix the problem.

@adsilcott
Copy link

Definitely having this problem. Recipe Grabber seems to add an Author property, I've found that removing that, whether empty or not, lets the recipe render. Otherwise it's a blank page.

@ClockDk
Copy link

ClockDk commented Jan 10, 2024

A related problem. I normally use a template with some blank properties, if any are left blank the whole page disappears in recipe view, deleting the empty properties seems to fix the problem.

I have the same problem, but it only occurs, when i have the "tags" properties added :)

@deafmute1
Copy link

deafmute1 commented Jan 20, 2024

So I've been trying to find a workaround to this issue, and it seems to actually doesn't matter what the frontmatter contains, it will display a blank page on a freshly created recipe (in this case, generated by the Recipe Grabber plugin). However, simply editing the properties of the recipe after creation, even if you immediately reverse the change, seems to be a 100% reliable workaround. So i delete a single character from a property, click away, then add the character back and the recipe always displays fine from then on.

@spikex
Copy link

spikex commented Feb 4, 2024

The problem is how Recipe Grabber creates the tags front matter. It creates:

tags: recipe

However, Obsidian wants tags to be an array:

tags:
  - recipe

If you edit any properties, Obsidian corrects the tags property when writing the new front matter, which is why any edit fixes it.

Change the Recipe Grabber template to:

---
tags: 
    - recipe 
created: {{datePublished}}
author: {{author.name}}
url: {{url}} 
---

and Recipe Grabber will work out of the box.

Technically, this isn't Recipe View's problem, but treating tags: recipe as if it were an array would prevent the crash.

@Merrit
Copy link

Merrit commented Feb 6, 2024

Tested just now on the same link that failed for me before, and it worked correctly. Seems promising - thanks @spikex!

Lanjelin added a commit to Lanjelin/obsidian-recipe-grabber that referenced this issue Apr 10, 2024
As pointed out in an issue in obsidian-recipe-view
lachholden/obsidian-recipe-view#16 (comment)
seethroughdev pushed a commit to seethroughdev/obsidian-recipe-grabber that referenced this issue Apr 18, 2024
* Tags are expected to be an array

As pointed out in an issue in obsidian-recipe-view
lachholden/obsidian-recipe-view#16 (comment)

* Added handlebar function for tags

Added a custom handlebar function to split comma separated strings
into a list for use with Obsidian tags property.

* Updated image grabbing

Fixed speces breaking image links.
Updated image grabber to grab images from instructions.
Added option to store images in subdirectories named after recipe.

* prettyTime handlebar

Added handlebar to prettify time

* Fix image numbering

* Check for local images

Use local images if they exists, instead of attempting to overwrite

* Ability to make a timestamp on save

Through adding the handlebar `savedAt`

* Fix null value bug

* Added magicTime, replacing prettyTime and savedAt
seethroughdev added a commit to seethroughdev/obsidian-recipe-grabber that referenced this issue May 3, 2024
Added Save Image option  (#22)

* added saveImgOption

* saveImg support

* Changed SaveImg default + added info in readme

Some changes (#25)

* Tags are expected to be an array

As pointed out in an issue in obsidian-recipe-view
lachholden/obsidian-recipe-view#16 (comment)

* Added handlebar function for tags

Added a custom handlebar function to split comma separated strings
into a list for use with Obsidian tags property.

* Updated image grabbing

Fixed speces breaking image links.
Updated image grabber to grab images from instructions.
Added option to store images in subdirectories named after recipe.

* prettyTime handlebar

Added handlebar to prettify time

* Fix image numbering

* Check for local images

Use local images if they exists, instead of attempting to overwrite

* Ability to make a timestamp on save

Through adding the handlebar `savedAt`

* Fix null value bug

* Added magicTime, replacing prettyTime and savedAt

add ci cleanup (#26)

* add ci cleanup

* bug fixes from review

* Reordered checks in magicTime for readability

---------

Co-authored-by: lanjelin <6988319+Lanjelin@users.noreply.github.com>
seethroughdev added a commit to seethroughdev/obsidian-recipe-grabber that referenced this issue May 3, 2024
Added Save Image option  (#22)

* added saveImgOption

* saveImg support

* Changed SaveImg default + added info in readme

Some changes (#25)

* Tags are expected to be an array

As pointed out in an issue in obsidian-recipe-view
lachholden/obsidian-recipe-view#16 (comment)

* Added handlebar function for tags

Added a custom handlebar function to split comma separated strings
into a list for use with Obsidian tags property.

* Updated image grabbing

Fixed speces breaking image links.
Updated image grabber to grab images from instructions.
Added option to store images in subdirectories named after recipe.

* prettyTime handlebar

Added handlebar to prettify time

* Fix image numbering

* Check for local images

Use local images if they exists, instead of attempting to overwrite

* Ability to make a timestamp on save

Through adding the handlebar `savedAt`

* Fix null value bug

* Added magicTime, replacing prettyTime and savedAt

add ci cleanup (#26)

* add ci cleanup

* bug fixes from review

* Reordered checks in magicTime for readability

---------

Co-authored-by: lanjelin <6988319+Lanjelin@users.noreply.github.com>
@lachholden lachholden added this to the 1.0 milestone May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants