Preheat oven to 200°C. Cut pumpkin into 2cm cubes and toss in a roasting pan with half of the olive oil and the garlic. Roast for 30 minutes until soft and golden.
Meanwhile, place stock in a small saucepan, bring to the boil, reduce heat and simmer. Heat remaining oil in a saucepan and cook onion for 5 minutes until soft. Stir in rice and cook, for 3 minutes until pale golden. Add 1 cup of stock to the rice, stir constantly over medium heat until stock has been absorbed. Continue adding stock and stirring until all of the stock has been used and rice is tender.
Stir through roasted pumpkin, pesto and butter. Season to taste. Serve topped with baby spinach and shaved parmesan.