Preheat the oven to 350°F (175°C).
Grease and flour two 9-inch round cake pans.
Cream the butter and sugar in a large bowl using a mixer until light and fluffy.
Add the eggs one at a time, mixing well after each addition.
In a separate bowl, whisk together the flour, cocoa powder, baking powder, and baking soda.
Gradually add the dry ingredients to the wet mixture, alternating with milk. Begin and end with the dry ingredients. Mix until smooth.
Divide the batter evenly between the prepared pans and smooth the tops with a spatula.
Bake for 25–30 minutes or until a toothpick inserted into the center comes out clean.
Let the cakes cool in the pans for 10 minutes, then transfer them to a wire rack to cool completely.
Mix the shredded coconut with ½ cup sweetened condensed milk (or heavy cream) in a bowl until it reaches a spreadable consistency.
Place one cake layer on a serving plate.
Spread half of the coconut filling evenly on top of the first layer.
Add the second cake layer and spread the remaining coconut filling over the top.
Heat 1 cup heavy cream in a saucepan until it just begins to simmer.
Remove from heat and pour over 8 ounces of chopped dark chocolate.
Let sit for 2–3 minutes, then stir until smooth to create the ganache.
Pour the ganache over the assembled cake, letting it drip down the sides.
Generously sprinkle shredded coconut over the top and sides of the cake.