With all the great help from Andy, I now understand how to reuse the same content on different pages within a Grav site.
Given that, I’d like to next present the same content differently on different pages. For example, given a list of youtube links on a markdown page might be displayed pretty much as-is on one page, but on another page use iframes to embed the videos on the page.
From what I understand, different Twig files for each page involved should be able to accomplish this. Is this correct, and is this the recommended approach to achieve the above?
That is correct, the page is the data and you can use different Twig templates to render that data in different ways. Don’t forget you are not limited to only the content of the page, you have the ability to set custom header options too.
Not really. I can’t think of anywhere we’re doing this in our skeletons or demos. It’s just a matter of creating multiple twig files that have different rendering.
I now better understand that to use different content presentations I just need to have different twig files for the same markdown data. One example usage scenario for me is to have a markdown file contain a title and a short list of youtube links, and have one twig template render basically as-is, but have another twig template render each youtube video as an embedded video.
I’ve been looking for some example Twig code to process a markdown file for links, and for each link insert the found URL into a chunk of iframe code (i.e. to embed a YouTube video) but I’ve had no luck so far.
With the additional details above, would anyone know of an example I could review to learn how to possibly do this?