Preheat the oven to 165°c (fan).
Put all of the plain flour and 50g of caster sugar in a mixing bowl before rubbing in 100g of unsalted butter with your fingertips. When the mixture resembles crumbs, pour it into a lined traybake tin, spread it evenly and press it down so the crumbs loosely join together.
Bake the base for 15 minutes.
While the base is baking, combine the remaining 100g of butter, 100g caster sugar, ground almonds and the egg in the mixing bowl with a spoon to make the frangipane topping.
When the base has baked for 15 minutes, remove it from the oven and add the jam, spreading it with the back of a spoon to make an even layer over the top. Spread the frangipane mix on top of the jam (this will be a thicker layer) and sprinkle on the flaked almonds before returning to the oven for a further 30 minutes.
When the traybake is golden on top, remove from the oven and allow to cool completely before removing from the tin.
Dust the whole thing with icing sugar, slice into bars and top with more flaked almonds. Enjoy!