I’m thinking about how to create a good workflow for breadcrumbs in my app.
Right now I have the breadcrumbs directly in the HTML
<span><a href="<%= Routes.static_path(@conn, "/my_page") %>">A title for the page</a></span>
But I’d like to have them available from within the layout so I can set the breadcrumbs in a script tag for JSON LD.
I think this would mean creating the breadcrumbs in the controller method and then setting them in the assigns.
Is there a way to do this within the html as it would be nice to be able to set them there, but have them picked up earlier in the rendering for the JSON LD bit from the layout. I don’t know if there’s a way to do something like that.
Thanks for any help.