varia.website/plugins/linker/content_objects.py

13 lines
369 B
Python
Raw Normal View History

2018-02-01 14:46:15 +01:00
# -*- coding: utf-8 -*-
from pelican import signals
def initialize_content_object_set(app):
app.settings['content_objects'] = set()
def collect_content_objects(co):
context = co._context['content_objects'].add(co)
def register():
signals.initialized.connect(initialize_content_object_set)
signals.content_object_init.connect(collect_content_objects)