mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Change name of utils.open function to pelican_open and refactor this change across project.
This commit is contained in:
parent
1ca2a77c05
commit
0c2625e59d
2 changed files with 7 additions and 6 deletions
|
|
@ -16,7 +16,7 @@ except ImportError:
|
|||
import re
|
||||
|
||||
from pelican.contents import Category, Tag, Author
|
||||
from pelican.utils import get_date, open
|
||||
from pelican.utils import get_date, pelican_open
|
||||
|
||||
|
||||
_METADATA_PROCESSORS = {
|
||||
|
|
@ -129,7 +129,7 @@ class MarkdownReader(Reader):
|
|||
|
||||
def read(self, filename):
|
||||
"""Parse content and metadata of markdown files"""
|
||||
text = open(filename)
|
||||
text = pelican_open(filename)
|
||||
md = Markdown(extensions=set(self.extensions + ['meta']))
|
||||
content = md.convert(text)
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ class HtmlReader(Reader):
|
|||
|
||||
def read(self, filename):
|
||||
"""Parse content and metadata of (x)HTML files"""
|
||||
with open(filename) as content:
|
||||
with pelican_open(filename) as content:
|
||||
metadata = {'title': 'unnamed'}
|
||||
for i in self._re.findall(content):
|
||||
key = i.split(':')[0][5:].strip()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue