1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 15:49:42 +02:00

feat: consolidate deployment targets and publish to ghcr.io (#2539)

* WIP: proof of concept

* basic meta tag injection

* add support for scraping public/private links

* make tests go brrrrr

* cleanup initialization

* rewrite build config

* remove recipe meta on frontend

* make type checker happy

* remove other deployment methods

* fix issue with JSON response on un-authenticated request

* docs updates

* update tivy scanner

* fix linter stuff

* change registry tag

* build fixes

* fix same mistake I always make
This commit is contained in:
Hayden 2023-09-14 06:40:13 -08:00 committed by GitHub
parent aec4cb4f31
commit 2ad6af2cce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 268 additions and 793 deletions

View file

@ -3,4 +3,3 @@ export { useRecipe } from "./use-recipe";
export { useRecipes, recentRecipes, allRecipes, useLazyRecipes } from "./use-recipes";
export { parseIngredientText, useParsedIngredientText } from "./use-recipe-ingredients";
export { useTools } from "./use-recipe-tools";
export { useRecipeMeta } from "./use-recipe-meta";

View file

@ -1,58 +0,0 @@
import { Ref } from "@nuxtjs/composition-api";
import { useStaticRoutes } from "~/composables/api";
import { Recipe } from "~/lib/api/types/recipe";
export interface RecipeMeta {
title?: string;
mainImage?: string;
meta: Array<any>;
__dangerouslyDisableSanitizers: Array<string>;
script: Array<any>;
}
export const useRecipeMeta = () => {
const { recipeImage } = useStaticRoutes();
function recipeMeta(recipe: Ref<Recipe | null>): RecipeMeta {
const imageURL = recipeImage(recipe?.value?.id ?? "");
return {
title: recipe?.value?.name,
mainImage: imageURL,
meta: [
{ hid: "og:title", property: "og:title", content: recipe?.value?.name || "Recipe" },
{
hid: "og:description",
property: "og:description",
content: recipe?.value?.description ?? "",
},
{
hid: "og:image",
property: "og:image",
content: imageURL,
},
{
hid: "twitter:title",
property: "twitter:title",
content: recipe?.value?.name ?? "",
},
{
hid: "twitter:desc",
property: "twitter:description",
content: recipe?.value?.description ?? "",
},
{ hid: "t-type", name: "twitter:card", content: "summary_large_image" },
],
__dangerouslyDisableSanitizers: ["script"],
script: [
{
innerHTML: JSON.stringify({
"@context": "http://schema.org",
"@type": "Recipe",
...recipe.value,
}),
type: "application/ld+json",
},
],
};
}
return { recipeMeta };
};