Filter out empty sections when generating pages