In a large mixing bowl, whisk together the all-purpose flour, unsweetened cocoa powder, baking soda, and salt until well blended.
In another bowl, beat the softened unsalted butter and granulated sugar together until light and fluffy.
Mix in the egg and vanilla extract until fully incorporated.
Gradually add the dry ingredients alternately with the buttermilk, mixing just until combined.
Spoon the batter into a baking pan lined with parchment paper, leaving space for spreading.
Bake at 350°F for 10-12 minutes or until set, then cool on a wire rack.
For the filling, combine granulated sugar, egg yolks, butter, coconut, pecans, and vanilla in a saucepan and cook until thickened.
Spread the filling on the flat side of one cake and top with another cake.