Toss diced butternut squash with olive oil, salt, pepper, and thyme. Roast at 200°C (400°F) for 25 minutes or until golden and soft.
In a pan, sauté the sliced onion in a little oil until caramelized and sweet, about 10 minutes.
Rub butter into flour and salt until crumbly. Add egg yolk and water. Roll out and line a tart tin. Prick with a fork and bake blind at 180°C (350°F) for 10 minutes.
In a bowl, mix ricotta, egg, salt, pepper, and half the feta. Stir in roasted squash and onions gently.
Spoon filling into the baked crust, top with the remaining feta and sage leaves.
Bake at 180°C (350°F) for 25–30 minutes until golden and set.