Add onion, sugar, balsamic vinegar, olive oil and salt into a small saucepan and cook over a low heat until the onion has softened and caramelised. Drain and allow to cool.

Preheat the oven to 180C.

Peel and slice the unseeded section of pumpkin into 3mm slices.

Place the pastry on the a baking tray lined with baking paper. With a ruler and sharp knife score a line 2cms inside the edge all the way around the rectangle making sure you do not cut through the pastry. Combine egg yolk with a few drops of water and brush the pastry between the edges and the scored line. 

Place the onion into the centre of the rectangle of pastry within the score lines.Spread it over the pastry evenly. 

Place the slices of pumpkin on top of the onion within the score lines, overlapping each slice slightly and all facing the same way.

Drizzle the pumpkin with a little olive oil.

Place the baking tray into the centre of the oven and cook until the pastry is golden brown and the pumpkin is soft. This will take approx 30 – 40mins. It the pastry starts becoming too brown cover loosely with alfoil to prevent further browning.

Serve warm with fresh thyme leaves scattered over the pumpkin.