Is there a way to preserve liquid variables across pages during processing?

You can’t access something across pages like that unfortunately.

I think the excerpt may not work if you post starts with something other than a p tag? does yours start with an image or something?

seems hacky but maybe your code would work as an include and then pass in the post content as a parameter? not a great idea really.