I’ve picked up my pet project (again). A granddaughter from woman in Germany reached out to me and asked if I ever finished… That was so sweet! So I decided to pick it up again. I ran into an issue. I’ve made photos of roughly 100+ cards and with the power of AI I made a YAML file with the information. OCR.
I created a fresh installation and I added the recipes.YAML in my data folder. With this code
in the Layout folder I try to call the YAML file. And with a MD file in content I try to display it.
The original publisher is still around and they where surprised… no one knew they once published these cards. It’s in a lot of German families. Also referred to as the red box.
- title: "Grapefruit in a Glass"
category: "Starters"
ingredients:
- "2 grapefruits"
- "Sugar, to taste"
- "Angostura, to taste (can be replaced with port wine or cherry liqueur)"
- "4 cocktail cherries```
Updated
title: "Grapefruit in a Glass"
category: "Starters"
ingredients:
- "2 grapefruits"
- "Sugar, to taste"
- "Angostura, to taste (can be replaced with port wine or cherry liqueur)"
- "4 cocktail cherries"
instructions:
"Halve the grapefruits horizontally and place them directly into serving dishes to preserve the juice. Precut the segments of the grapefruit flesh, using a special serrated knife. Lightly sugar to taste, add a few drops of Angostura to the center of each half, and top with a cocktail cherry. Serve fresh and well-chilled in glass or champagne bowls."
prep_time: "10 minutes"
cook_time: "0 minutes"
This error code is a bit puzzling,
can’t evaluate field title in type interface {}
error: error building site: “/Documents/kock/kock/content/pages/recipes.md:10:1”: failed to render shortcode “recipes”: failed to process shortcode: “/Documents/kock/kock/layouts/shortcodes/recipes.html:3:11”: execute of template failed: template: shortcodes/recipes.html:3:11: executing “shortcodes/recipes.html” at <.title>: can’t evaluate field title in type interface {}
The problem was my misunderstanding of YAML files. And reading them in a Hugo site. Thanks @razon for the help!
I’m going to continue work on this project.
Next on the list: adding images (original scans) to every recipe. After that, I’m asking an AI to help me with calories per serving (somehow this wasn’t an issue in the '70s in Germany)