content_objects.py 369 B

12345678910111213
  1. # -*- coding: utf-8 -*-
  2. from pelican import signals
  3. def initialize_content_object_set(app):
  4. app.settings['content_objects'] = set()
  5. def collect_content_objects(co):
  6. context = co._context['content_objects'].add(co)
  7. def register():
  8. signals.initialized.connect(initialize_content_object_set)
  9. signals.content_object_init.connect(collect_content_objects)