mealie icon indicating copy to clipboard operation
mealie copied to clipboard

[v1.0.0b] [Task] - Allow Mealie Recipes to be Scraped by Mealie/Others

Open hay-kot opened this issue 3 years ago • 1 comments

What is the problem this task addresses?

Currently no schema is provided in the Meta Tags according to the schema.org specifications.

Proposed/Possible Solution(s)?

  • [ ] Write a server-side javascript function to convert Mealie to Schema.org
  • [ ] Publish that (server-side) on the share pages.

SSR is already implemented so all that really should need to be done is to write the converter and add the proper data to the function on the shared page.

hay-kot avatar Dec 07 '21 02:12 hay-kot

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 24 '22 07:05 stale[bot]

Hey, I wanted to look into this, but it looks like this has already been implemented? At least the RecipePage uses useMeta and that already contains ld+json data that also shows up in the page.

One thing I'm not sure about is whether this should be available without running JavaScript, e.g. the mealie scraper itself doesn't seem to run JavaScript, which is why it can't find this data. Is there a way to tell Nuxt to include this data in the initial HTML page?

xarantolus avatar Nov 09 '22 10:11 xarantolus

Is there a way to tell Nuxt to include this data in the initial HTML page?

SSR should be happening in production but not development. It's a limitation of Nuxt/Vite right now. Hopefully this get's resolved in Nuxt v3

Hey, I wanted to look into this, but it looks like this has already been implemented? At least the RecipePage uses useMeta and that already contains ld+json data that also shows up in the page.

As far as I've tested (and remember), it only partially works. I think the main parts are there, but some debugging and troubleshooting needs to happen to get this working 100%. The main issue is that you need to build the docker image to test since that's the only way to support SSR at the moment.

Workflow is Make Changes -> Build Image -> Test Scraper

To test you can use the recipe-scrapers package and write a small python script to hit your local endpoint.

  • https://github.com/hhursev/recipe-scrapers

This one's sort of weird to work on so let me know if you need any help or tag me on the discord channel!

hay-kot avatar Nov 09 '22 20:11 hay-kot