mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-06-03 13:44:55 -04:00
parent
7eb80d18d2
commit
eca8a96509
@ -11,15 +11,15 @@ export const useStaticRoutes = () => {
|
|||||||
|
|
||||||
// Methods to Generate reference urls for assets/images *
|
// Methods to Generate reference urls for assets/images *
|
||||||
function recipeImage(recipeId: string, version = "", key = 1) {
|
function recipeImage(recipeId: string, version = "", key = 1) {
|
||||||
return `${fullBase}/media/recipes/${recipeId}/images/original.webp?&rnd=${key}&version=${version}`;
|
return `${fullBase}/media/recipes/${recipeId}/images/original.webp?rnd=${key}&version=${version}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function recipeSmallImage(recipeId: string, version = "", key = 1) {
|
function recipeSmallImage(recipeId: string, version = "", key = 1) {
|
||||||
return `${fullBase}/media/recipes/${recipeId}/images/min-original.webp?&rnd=${key}&version=${version}`;
|
return `${fullBase}/media/recipes/${recipeId}/images/min-original.webp?rnd=${key}&version=${version}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function recipeTinyImage(recipeId: string, version = "", key = 1) {
|
function recipeTinyImage(recipeId: string, version = "", key = 1) {
|
||||||
return `${fullBase}/media/recipes/${recipeId}/images/tiny-original.webp?&rnd=${key}&version=${version}`;
|
return `${fullBase}/media/recipes/${recipeId}/images/tiny-original.webp?rnd=${key}&version=${version}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function recipeAssetPath(recipeId: string, assetName: string) {
|
function recipeAssetPath(recipeId: string, assetName: string) {
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
:key="imageKey"
|
:key="imageKey"
|
||||||
:max-width="enableLandscape ? null : '50%'"
|
:max-width="enableLandscape ? null : '50%'"
|
||||||
:height="hideImage ? '50' : imageHeight"
|
:height="hideImage ? '50' : imageHeight"
|
||||||
:src="recipeImage(recipe.slug, imageKey)"
|
:src="recipeImage(recipe.id, imageKey)"
|
||||||
class="d-print-none"
|
class="d-print-none"
|
||||||
@error="hideImage = true"
|
@error="hideImage = true"
|
||||||
>
|
>
|
||||||
@ -197,6 +197,9 @@
|
|||||||
:disable-amount="recipe.settings.disableAmount"
|
:disable-amount="recipe.settings.disableAmount"
|
||||||
:edit="form"
|
:edit="form"
|
||||||
public
|
public
|
||||||
|
:assets="recipe.assets"
|
||||||
|
:recipe-id="recipe.id"
|
||||||
|
:recipe-slug="recipe.slug"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- TODO: Somehow fix duplicate code for mobile/desktop -->
|
<!-- TODO: Somehow fix duplicate code for mobile/desktop -->
|
||||||
@ -323,7 +326,6 @@ export default defineComponent({
|
|||||||
const { data } = await api.recipes.getShared(id);
|
const { data } = await api.recipes.getShared(id);
|
||||||
if (data) {
|
if (data) {
|
||||||
if (data && data !== undefined) {
|
if (data && data !== undefined) {
|
||||||
console.log("Computed Meta. RefKey=");
|
|
||||||
const imageURL = data.id ? recipeImage(data.id) : undefined;
|
const imageURL = data.id ? recipeImage(data.id) : undefined;
|
||||||
title.value = data.name;
|
title.value = data.name;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user