from pelican import signals def split_to_quotes_section(article): article_sections = article._content.split(''); article._content = article_sections[0] if len(article_sections) > 1: article.quotes = article_sections[1] def split_to_bio_section(article): article_sections = article._content.split(''); article._content = article_sections[0] if len(article_sections) > 1: article.bio = article_sections[1] def article_add_quotes(article_generator): for article in article_generator.articles: split_to_quotes_section(article) for translation in article.translations: split_to_quotes_section(translation) def page_add_bio(page_generator): for page in page_generator.pages: split_to_bio_section(page) for translation in page.translations: split_to_bio_section(translation) def register(): signals.article_generator_finalized.connect(article_add_quotes) signals.page_generator_finalized.connect(page_add_bio)