forked from github/pelican
control scope of identification of translations with new settings
This commit is contained in:
parent
c97c128d16
commit
77c967f1db
8 changed files with 165 additions and 99 deletions
|
|
@ -17,6 +17,7 @@ from tempfile import mkdtemp
|
|||
from six import StringIO
|
||||
|
||||
from pelican.contents import Article
|
||||
from pelican.readers import default_metadata
|
||||
from pelican.settings import DEFAULT_CONFIG
|
||||
|
||||
__all__ = ['get_article', 'unittest', ]
|
||||
|
|
@ -113,9 +114,10 @@ def mute(returns_output=False):
|
|||
return decorator
|
||||
|
||||
|
||||
def get_article(title, slug, content, lang, extra_metadata=None):
|
||||
metadata = {'slug': slug, 'title': title, 'lang': lang}
|
||||
if extra_metadata is not None:
|
||||
def get_article(title, content, **extra_metadata):
|
||||
metadata = default_metadata(settings=DEFAULT_CONFIG)
|
||||
metadata['title'] = title
|
||||
if extra_metadata:
|
||||
metadata.update(extra_metadata)
|
||||
return Article(content, metadata=metadata)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue