From f61bb87c8e776d0db7633ecdc57d28119449ccad Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:19:48 +0000 Subject: [PATCH] fix bookmarklet --- .../community-guide/import-recipe-bookmarklet.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/docs/documentation/community-guide/import-recipe-bookmarklet.md b/docs/docs/documentation/community-guide/import-recipe-bookmarklet.md index 64326dc1a96..0755605bc95 100644 --- a/docs/docs/documentation/community-guide/import-recipe-bookmarklet.md +++ b/docs/docs/documentation/community-guide/import-recipe-bookmarklet.md @@ -6,15 +6,16 @@ You can use bookmarklets to generate a bookmark that will take your current loca You can use a [bookmarklet generator site](https://caiorss.github.io/bookmarklet-maker/) and the code below to generate a bookmark for your site. Just change the `http://localhost:8080` to your sites web address and follow the instructions. - -!!! note - There is no trailing `/` at the end of the url! - ```js var url = document.URL; var mealie = "http://localhost:8080"; +var group_slug = "home" // Change this to your group slug. You can obtain this from your URL after logging-in to Mealie var use_keywords= "&use_keywords=1" // Optional - use keywords from recipe - update to "" if you don't want that var edity = "&edit=1" // Optional - keep in edit mode - update to "" if you don't want that -var dest = mealie + "/r/create/url?recipe_import_url=" + url + use_keywords + edity; + +if (mealie.slice(-1) === "/") { + mealie = mealie.slice(0, -1) +} +var dest = mealie + "/g/" + group_slug + "/r/create/url?recipe_import_url=" + url + use_keywords + edity; window.open(dest, "_blank"); ```