Set __filename and __dirname variables in templates.