Pulse flour, butter, sugar, and egg in a food processor until combined, adding milk if necessary.
Roll out dough on a floured surface to line a 26cm tin and chill for one hour.
Preheat the oven to 200°C.
Line the pastry with greaseproof paper and baking beans, then bake blind for 15-20 minutes.
Remove weights, brush with egg, bake for 5 minutes, then reduce oven to 180°C.
Beat filling butter and sugar until pale and fluffy.
Mix in ground almonds and add eggs one at a time, beating well.
Fold in lemon zest and flour.
Spread jam over the pastry base, leaving a 2.5cm gap at the edge.
Spread filling over the jam and sprinkle with flaked almonds.
Bake for 20 minutes until golden-brown and cool in the tin before serving.