Preheat the oven to 200°C/fan 180°C/gas 6.
Pop the squash on a baking tray with some salt and pepper and a drizzle of olive oil, and roast in the oven for 30 minutes, until golden.
While the squash is roasting, roast the pistachios and sunflower or pumpkin seeds on a baking tray in the hot oven for 5 minutes.
Remove the tray of nuts and seeds and tip them into a food processor with the chestnuts, olive oil, maple syrup, lemon zest, thyme, and a good pinch of salt and pepper. Blitz until you have a fine crumbly paste.
If it is too crumbly, add a touch more oil until it comes together into a solid piece.
Lay a sheet of baking paper on your work surface, then tip out the paste and shape it into a circle with your hands.
Place another sheet of baking paper on top and use a rolling pin to roll it out into a pizza-sized circle about 0.5cm thick.
Put it on a baking tray and take off the top sheet of paper, then prick the dough with a fork and pop it into the oven alongside the squash for 15–20 minutes, until golden around the edges.
Fry the red onion in a little oil with a pinch of salt until deep violet, sweet and just starting to colour (about 10 minutes).
Put all the topping ingredients (soaked cashews, avocado flesh, spinach, and lemon juice) into a blender with a good amount of salt and pepper and blitz until smooth.
Once the galette base has cooled a little, spread it with the spinach topping and scatter over the red onion, squash, and red chilli.
