How should I store dynamic data in the Page object? (hugo serve -w)

Perhaps it would be easier to write a shortcode that you apply only when you need it, namely once to add the script and style elements?