add scripts from template to the head of main page