Preheat the oven to 220°C/425ºF. Separate a pastry sheet and cut out 4 x 12cm/1½ x 4 ¾ inch circles. Use a slightly smaller cutter or a sharp knife to score a 1cm1/4 inch border on each - this will form the rim. Place the circles on a baking sheet.

Heat the oil in a large skillet over a medium heat, add onions and stir for 5 minutes or until softened. Add the chili and cook gently for 1 minute, season.

Spread the pesto over the pastry circles, leaving the rim clear. Spoon the onion mixture over the pesto and scatter with the pine nuts. Cook for 12-15 minutes, until the pastry has risen and is golden brown.