소스 검색

Maintain backward compatibility by not requiring that pelicanhtml is copied to the blog home

Jörg Dietrich 11 년 전
부모
커밋
8d6a4a9d79
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      liquid_tags/notebook.py

+ 5 - 1
liquid_tags/notebook.py

@@ -248,8 +248,12 @@ def notebook(preprocessor, tag, markup):
                 'SubCell':
                     {'enabled':True, 'start':start, 'end':end}})
 
+    if os.path.exists('pelicanhtml.tpl'):
+        template_file = 'pelicanhtml'
+    else:
+        template_file = 'basic'
     exporter = HTMLExporter(config=c,
-                            template_file='pelicanhtml',
+                            template_file=template_file,
                             filters={'highlight2html': custom_highlighter},
                             transformers=[SubCell])