Preheat your oven to 350°F (175°C).
Grease and line two 8-inch round cake pans with parchment paper.
In a large bowl, sift together the flour, cocoa powder, baking powder, baking soda, and salt.
In another bowl, whisk together the granulated sugar, light brown sugar, dairy-free buttermilk, vegetable oil, and vanilla extract until smooth.
Add the wet ingredients to the dry ingredients, mixing until just combined. Be careful not to overmix.
Fold in the grated courgette (and dairy-free yogurt if using) until evenly distributed.
Divide the batter evenly between the prepared cake pans.
Bake for 45-50 minutes, or until a toothpick inserted into the center comes out clean.
Allow the cakes to cool in the pans for 10 minutes, then transfer to a wire rack to cool completely.