How can I modify yaml instructions outside of the document I am rendering

Please provide a reproducible example, called a reprex