How to add custom code script (js cdn link and code) only for blog template pages? I don't want to add this to all pages

How to add custom code script (js cdn link and code) only for blog template pages?
I don’t want to add this to all pages.

On each and every blog page… there will be a download button which will download some portion of that page as a pdf.