01 - Set oven to 400°F (200°C). Line a baking tray with parchment paper.
02 - Heat olive oil in a skillet over medium heat. Sauté chopped onion for approximately 3 minutes until softened. Add minced garlic and cook for an additional 30 seconds.
03 - Add spinach to the skillet. If using fresh spinach, cook until wilted; if using thawed frozen spinach, heat through. Remove excess moisture by pressing with a spoon or draining in a sieve. Allow mixture to cool slightly.
04 - Transfer spinach mixture to a bowl. Stir in crumbled feta, ground nutmeg, salt, and pepper until evenly combined.
05 - Unroll puff pastry on a lightly floured surface. Evenly spread the spinach and feta mixture over half the sheet, leaving a small border around the edges.
06 - Fold the pastry sheet over the filling to encase it. Press the edges gently to seal and cut into 12 strips about 0.75 inch wide.
07 - Twist each strip several times and arrange on the prepared baking tray. Brush the tops with beaten egg and sprinkle with seeds, if desired.
08 - Bake in the preheated oven for 18 to 20 minutes or until the pastry is golden and crisp. Let cool slightly before serving.