01 - Preheat oven to 400°F (200°C) and line a baking tray with parchment paper.
02 - Heat olive oil in a skillet over medium heat. Add chopped onion and sauté until softened, about 3 minutes. Stir in minced garlic and cook for an additional 30 seconds.
03 - Add spinach to the skillet. If using fresh, cook until wilted; if using thawed, heat through. Remove excess moisture by pressing the mixture with a spoon or draining in a sieve. Allow to cool slightly.
04 - Stir crumbled feta, ground nutmeg, salt, and pepper into the cooled spinach mixture. Mix thoroughly to combine.
05 - Unroll puff pastry sheet onto a lightly floured surface. Evenly spread spinach-feta filling over half of the pastry, leaving a narrow border around the edges.
06 - Fold pastry over to encase the filling. Lightly press to seal. Cut the filled pastry into 12 strips, each about 3/4 inch wide.
07 - Gently twist each strip and arrange on the prepared baking tray. Brush with beaten egg and sprinkle with sesame or nigella seeds, if desired.
08 - Bake for 18 to 20 minutes until golden brown and crisp. Allow to cool briefly before serving.