I want to write event structured data in the <head>
of some of my Blazor pages, where the content is specific to the page.
So it is:
<head>
<script type="application/ld+json">
/* 15 - 30 lines of JSON */
</script>
</head>
This would get added to App.razor
I think.
Do I put a string [CascadingParameter]
in App.razor.cs
, set it as @MyEventScript
in App.razor, and then assign it in the child @Body
MyPage.razor.cs
?
I’m asking for what is a supported way to do this. (Not the opinion “best”, but what approach is using supported functionality in Blazor and therefore will continue to work in future versions.)