File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -88,16 +88,8 @@ def on_pre_build(self, config):
8888 ),
8989 )
9090
91- def on_page_read_source (self , page , config , ** kwargs ):
91+ def on_page_markdown (self , markdown , config , ** kwargs ):
9292 context = {key : config .get (key ) for key in CONFIG_KEYS if key in config }
9393 context .update (config .get ("extra" , {}))
94- try :
95- with open (page .file .abs_src_path , 'r' , encoding = 'utf-8-sig' , errors = 'strict' ) as f :
96- md_template = Template (f .read ())
97- return md_template .render (** config .get ("extra" ))
98- except OSError :
99- log .error ('File not found: {}' .format (self .file .src_path ))
100- raise
101- except ValueError :
102- log .error ('Encoding error reading file: {}' .format (self .file .src_path ))
103- raise
94+ md_template = Template (markdown )
95+ return md_template .render (** config .get ("extra" ))
You can’t perform that action at this time.
0 commit comments