소스 검색

fix to static sync

version-14
Rushabh Mehta 11 년 전
부모
커밋
80b4ca88c3
2개의 변경된 파일12개의 추가작업 그리고 11개의 파일을 삭제
  1. +11
    -10
      webnotes/website/doctype/web_page/web_page.py
  2. +1
    -1
      webnotes/webutils.py

+ 11
- 10
webnotes/website/doctype/web_page/web_page.py 파일 보기

@@ -48,7 +48,7 @@ def _sync_statics():
def sync_file(fname, fpath, statics_path, priority=0):
url = os.path.relpath(fpath, statics_path).rsplit(".", 1)[0]
if fname.rsplit(".", 1)[0]=="index":
if fname.rsplit(".", 1)[0]=="index" and os.path.dirname(fpath) != statics_path:
url = os.path.dirname(url)
parent_website_sitemap = os.path.dirname(url)
@@ -100,20 +100,21 @@ def _sync_statics():
with open(os.path.join(basepath, "index.txt"), "r") as indexfile:
index = indexfile.read().splitlines()
for fname in files:
page_name = fname.rsplit(".", 1)[0]
if page_name=="index" and fname!="index.txt":
sync_file(fname, os.path.join(basepath, fname), statics_path)
has_index = True
break
if basepath!=statics_path:
for fname in files:
page_name = fname.rsplit(".", 1)[0]
if page_name=="index" and fname!="index.txt":
sync_file(fname, os.path.join(basepath, fname), statics_path)
has_index = True
break
if not has_index:
continue
if not has_index:
continue
# other files
for fname in files:
page_name = fname.rsplit(".", 1)[0]
if page_name!="index":
if not (page_name=="index" and basepath!=statics_path):
sync_file(fname, os.path.join(basepath, fname), statics_path,
index.index(page_name) if page_name in index else 0)


+ 1
- 1
webnotes/webutils.py 파일 보기

@@ -147,7 +147,7 @@ def build_sitemap_options(path):

sitemap_options.children = webnotes.conn.sql("""select * from `tabWebsite Sitemap`
where parent_website_sitemap=%s
and public_read=1 order by idx asc""", (sitemap_options.name,), as_dict=True)
and public_read=1 order by idx asc, page_title asc""", (sitemap_options.name,), as_dict=True)
# determine templates to be used
if not sitemap_options.base_template_path:


불러오는 중...
취소
저장