更新pagetype模板文件

This commit is contained in:
jingrow 2025-10-25 12:03:14 +08:00
parent c8aefd3953
commit 01a60017a2
2 changed files with 10 additions and 3 deletions

View File

@ -43,7 +43,8 @@ async def create_pagetypes(payload: Dict[str, Any]):
if bp.exists(): if bp.exists():
backend_exists = True backend_exists = True
else: else:
bp.write_text("# coding: utf-8\n\n# Blank template for PageType backend hooks\n", encoding="utf-8") class_name = ''.join(word.capitalize() for word in slug.split('_'))
bp.write_text("# Copyright (c) 2025, jingrow and contributors\n# For license information, please see license.txt\n\n# import jingrow\nfrom jingrow.model.page import Page\n\n\nclass " + class_name + "(Page):\n\tpass\n", encoding="utf-8")
backend_path = str(bp) backend_path = str(bp)
return { return {

View File

@ -1,3 +1,9 @@
# coding: utf-8 # Copyright (c) 2025, jingrow and contributors
# For license information, please see license.txt
# Blank template for PageType backend hooks # import jingrow
from jingrow.model.page import Page
class TestPage(Page):
pass