If anyone’s curious, here’s the Stack Overflow question:
This is a fun question, but unfortunately I haven’t figured out a way to do this.
If it helps your searching, I think you’re looking for a way to get the rendered content of a page or post. Jekyll’s docs say that content is “rendered or un-rendered depending upon what Liquid is being processed and what page is” which isn’t super helpful. If you could find a way to get the rendered content, that would get you where you need to be.
Alternatively, you might do this with JavaScript instead. You could call the fetch() function to get the content of your second page.
Here’s a tutorial on the fetch() function if it helps: