mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Plugins doc + minor design changes.
This commit is contained in:
parent
c5a63c953a
commit
28c0644eb6
10 changed files with 97 additions and 18 deletions
|
|
@ -8,8 +8,6 @@ import os
|
|||
import math
|
||||
import random
|
||||
|
||||
from blinker import signal
|
||||
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
from jinja2.exceptions import TemplateNotFound
|
||||
|
||||
|
|
@ -17,6 +15,7 @@ from pelican.utils import copy, get_relative_path, process_translations, open
|
|||
from pelican.contents import Article, Page, is_valid_content
|
||||
from pelican.readers import read_file
|
||||
from pelican.log import *
|
||||
from pelican import signals
|
||||
|
||||
|
||||
class Generator(object):
|
||||
|
|
@ -100,7 +99,6 @@ class ArticlesGenerator(Generator):
|
|||
self.dates = {}
|
||||
self.tags = defaultdict(list)
|
||||
self.categories = defaultdict(list)
|
||||
self.signal = {'pelican_article_generate_context' : signal('pelican_article_generate_context')}
|
||||
super(ArticlesGenerator, self).__init__(*args, **kwargs)
|
||||
self.drafts = []
|
||||
|
||||
|
|
@ -214,7 +212,7 @@ class ArticlesGenerator(Generator):
|
|||
and self.settings['FALLBACK_ON_FS_DATE']:
|
||||
metadata['date'] = datetime.fromtimestamp(os.stat(f).st_ctime)
|
||||
|
||||
self.signal['pelican_article_generate_context'].send(self, metadata=metadata)
|
||||
signals.article_generate_context.send(self, metadata=metadata)
|
||||
article = Article(content, metadata, settings=self.settings,
|
||||
filename=f)
|
||||
if not is_valid_content(article, f):
|
||||
|
|
@ -318,7 +316,7 @@ class StaticGenerator(Generator):
|
|||
final_path=None):
|
||||
"""Copy all the paths from source to destination"""
|
||||
for path in paths:
|
||||
copy(path, source, os.path.join(output_path, destination), final_path,
|
||||
copy(path, source, os.path.join(output_path, destination), final_path,
|
||||
overwrite=True)
|
||||
|
||||
def generate_output(self, writer):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue