diff --git a/cms/disk.py b/cms/disk.py index 8a3b8f6..3d31f76 100644 --- a/cms/disk.py +++ b/cms/disk.py @@ -5,6 +5,7 @@ import os import importlib import importlib.util import copy +import mistune from mistune import markdown import re @@ -122,7 +123,8 @@ def html(_uri,_config) : _api = os.sep.join([f'{_context}/api/disk/read?uri=',_layout['root']]) if f"{_layout['root']}{os.sep}" in _html : _html = _html.replace(f"{_layout['root']}",_api) - _html = markdown(_html).replace(""",'"').replace("<","<").replace(">",">") if _uri[-2:] in ['md','MD','Md','mD'] else _html + _html = mistune.html(_html).replace(""",'"').replace("<","<").replace(">",">") if _uri[-2:] in ['md','MD','Md','mD'] else _html + return _html def plugins (**_args): diff --git a/cms/engine/project/__init__.py b/cms/engine/project/__init__.py index a24339f..7b1e6ef 100644 --- a/cms/engine/project/__init__.py +++ b/cms/engine/project/__init__.py @@ -118,7 +118,7 @@ def _index (_path,root):
""" _indexfile = os.sep.join([_path,'index.html']) - if os.path.exists(_indexfile): + if not os.path.exists(_indexfile) and os.path.exists(_path): # # In case a project needs to be upgraded ... f = open(_indexfile,'w') @@ -149,6 +149,7 @@ def make (**_args) : f.close() _ilogo(os.sep.join([_folder,_root])) + print ([_folder,_root]) _index(os.sep.join([_folder,_root]),_root) _itheme(_folder,_root) \ No newline at end of file diff --git a/cms/index.py b/cms/index.py index 7e002b6..5fbe446 100644 --- a/cms/index.py +++ b/cms/index.py @@ -177,23 +177,41 @@ def _version (): _handler = _route.get() global _config return _handler.system()['version'] -@_app.route('/reload',methods=['POST']) -def reload(): +@_app.route("/reload/