Preheat the oven to 200C/400F/Gas 6 and put a heavy baking tray in the oven to heat.
To make the onion marmalade, heat the oil in a non-stick frying pan over a high heat. Add the onion and fry for a few minutes. Sprinkle in the sugar and vinegar and season with sea salt and freshly ground black pepper. Cover and lower the heat for about 20 minutes or until soft. If the mixture is looking wet, remove the lid and let the liquid evaporate. Set the marmalade aside to cool.
For the galettes, cut each pepper in half, remove the stalk and seeds and lay cut side down on another baking tray. Drizzle with a little oil and roast in the oven for about 20 minutes or until the skins are black. Transfer to a plastic bag and seal. When cold, peel away the skin and slice into thin strips.
Roll the pastry out thinly on a floured work surface into a rectangle and trim the edges. Cut the pastry in half and prick with a fork. Transfer to a large piece of greaseproof paper and spread the goats’ cheese onto each piece of pastry, leaving a boarder around the edge. Spoon over the onion marmalade, scatter over the thmye and arrange the pepper strips on top.
Brush the edge of the pastry with the beaten egg and bake in the oven for 20-25 minutes, or until the pastry is crisp.