diff --git a/docs/index.js b/docs/index.js index 8566340..c4d21ff 100644 --- a/docs/index.js +++ b/docs/index.js @@ -37,6 +37,9 @@ // if (e.origin == 'null' || e.origin = ) { if (e.data.title) document.title = e.data.title; if (e.data.favicon) setFavicon(e.data.favicon); + if (e.data.updateURL) { + window.location.pathname = "/" + e.data.title.replace(" ", "_") + "/-/" + e.data.image + } if (e.data.setStorage) document.localStorage.setItem(contentHash, e.data.set); if (e.data.getStorage) document.getElementById("iframe").postMessage(document.localStorage.getItem(contentHash), e.origin) // } diff --git a/docs/render/recipe.js b/docs/render/recipe.js index 1ceb885..b253740 100644 --- a/docs/render/recipe.js +++ b/docs/render/recipe.js @@ -186,7 +186,7 @@ function render() { image = image?.url || image; instructions = json.recipeInstructions; let title = clean(json.name); - parent.postMessage({title:title, favicon:"🍳"}, "*"); + parent.postMessage({title:title, favicon:"🍳", image:image, updateURL:true}, "*"); // let text = instructions.join(" ");