pull/10/head
Steve Nyemba 6 months ago
parent d5ecc89479
commit b468e1ad0a

@ -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("&quot;",'"').replace("&lt;","<").replace("&gt;",">") if _uri[-2:] in ['md','MD','Md','mD'] else _html
_html = mistune.html(_html).replace("&quot;",'"').replace("&lt;","<").replace("&gt;",">") if _uri[-2:] in ['md','MD','Md','mD'] else _html
return _html
def plugins (**_args):

@ -118,7 +118,7 @@ def _index (_path,root):
</p>
"""
_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)

@ -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/<key>")
def _reload(key) :
global _route
_handler = _route.get_main()
_system = _handler.system()
_key = request.headers['key'] if 'key' in request.headers else None
if not 'source' in _system :
_systemKey = None
elif 'key' in _system['source'] and _system['source']['key']:
_systemKey = _system['source']['key']
print ([_key,_systemKey,_systemKey == _key])
if _key and _systemKey and _systemKey == _key :
print ([key,_systemKey,_systemKey == key])
if key and _systemKey and _systemKey == key :
_handler.reload()
return "",200
pass
return "",403
@_app.route('/reload',methods=['POST'])
def reload():
# global _route
# _handler = _route.get_main()
# _system = _handler.system()
_key = request.headers['key'] if 'key' in request.headers else None
return _reload(_key)
# if not 'source' in _system :
# _systemKey = None
# elif 'key' in _system['source'] and _system['source']['key']:
# _systemKey = _system['source']['key']
# print ([_key,_systemKey,_systemKey == _key])
# if _key and _systemKey and _systemKey == _key :
# _handler.reload()
# return "",200
# pass
# return "",403
@_app.route('/page',methods=['POST'])
def cms_page():
"""

@ -69,7 +69,7 @@ Vanderbilt University Medical Center
</script>
<body>
<div class="main">
<div class="main {{system.theme}}">
<div id="header" class="header" onclick="window.location.href='{{system.context}}/'" style="cursor:pointer">
{%include "header.html" %}
</div>

Loading…
Cancel
Save