Start by peeling the pineapples and removing the core. Chop the flesh into small pieces. Place the pineapple chunks into a food processor and blend until you achieve a chunky consistency.
Transfer the blended pineapple to a saucepan. Add the sugar, lemon juice, and optional cloves. Cook over medium heat, stirring frequently, until the mixture thickens and the sugar dissolves, about 15-20 minutes. Set aside to cool.
In a large mixing bowl, cream together the butter and sweetened condensed milk until light and fluffy. Add in the egg yolks and mix until well combined. Gradually add the all-purpose flour, mixing until a soft dough forms.
Wrap the dough in plastic wrap and refrigerate for at least 30 minutes. This helps to firm it up, making it easier to handle when shaping the cookies.
Preheat your oven to 350°F (175°C) while the dough chills.
On a floured surface, roll out the chilled dough to about ¼ inch thick. Cut into your desired shapes using cookie cutters. Place a small spoonful of the cooled pineapple filling in the center of each cutout. Fold over or place another cutout on top and seal the edges by pressing down with a fork.
In a small bowl, whisk together the egg yolks, condensed milk, and oil. Brush this mixture over the tops of the cookies for a beautiful golden finish.
Line your baking sheet with parchment paper and place the cookies on the sheet. Bake for 15-20 minutes or until they are lightly golden on the edges.
Once baked, transfer the cookies to a wire rack to cool completely. Enjoy your Best-Ever Pineapple Cookies (Pineapple Tarts) as a delightful treat with tea or coffee!