nprapps / liveblog-standalone

NPR's liveblog rig 2.0
Other
6 stars 1 forks source link

Move HTML injection into template tags #40

Closed thomaswilburn closed 4 years ago

thomaswilburn commented 4 years ago

We currently populate the HTML injected into the header via a metadata block. At one point, this was merely hidden, but the components inside could still activate, which caused double or triple requests for results data as the hidden embed booted up.

Our solution was to immediately remove the embed from the page on init, but that felt bad. A better solution is to wrap those chunks in a <template>, which causes its contents to be inert.