Files
Gnuboard7/templates/_bundled/sirsoft-basic/layouts/board/show.json
T
2026-07-01 10:30:32 +09:00

109 lines
3.5 KiB
JSON

{
"version": "1.0.0",
"layout_name": "board/show",
"permissions": [],
"extends": "_user_base",
"meta": {
"seo": {
"enabled": true,
"extensions": [
{ "type": "module", "id": "sirsoft-board" }
],
"data_sources": ["post"],
"page_type": "post",
"toggle_setting": "$module_settings:sirsoft-board:seo.seo_post_detail",
"vars": {
"site_name": "$core_settings:general.site_name",
"board_name": "{{post.data.board.name ?? ''}}",
"post_title": "{{post.data.title ?? ''}}"
},
"priority": 0.5,
"changefreq": "monthly",
"og": {
"type": "article",
"title": "{{_seo.post.title ?? post.data.title ?? ''}}",
"description": "{{_seo.post.description ?? post.data.content ?? ''}}"
}
}
},
"data_sources": [
{
"id": "post",
"label_key": "$t:editor.data_source.post",
"type": "api",
"endpoint": "/api/modules/sirsoft-board/boards/{{route.slug}}/posts/{{route.id}}",
"method": "GET",
"params": {
"del_cmt": "{{query.del_cmt ?? ''}}"
},
"auto_fetch": true,
"auth_mode": "optional",
"refetchOnMount": true,
"errorHandling": {
"401": {
"handler": "sequence",
"actions": [
{ "handler": "toast", "params": { "type": "info", "message": "$t:board.login_required" } },
{ "handler": "redirectToLoginWithReturn" }
]
},
"403": {
"handler": "showErrorPage",
"params": {
"target": "content"
}
},
"404": {
"handler": "showErrorPage",
"params": {
"target": "content"
}
}
}
},
{
"id": "navigation",
"label_key": "$t:editor.data_source.navigation",
"type": "api",
"endpoint": "/api/modules/sirsoft-board/boards/{{route.slug}}/posts/{{route.id}}/navigation",
"method": "GET",
"params": {
"del": "{{query.del ?? ''}}"
},
"auto_fetch": true,
"auth_mode": "optional",
"refetchOnMount": true
}
],
"computed": {
"commentRootMap": "{{(post?.data?.comments ?? []).reduce((map, c) => ({...map, [c.id]: c.depth === 0 ? c.id : (map[c.parent_id] ?? c.parent_id)}), {})}}"
},
"slots": {
"content": [
{
"type": "layout",
"name": "Container",
"props": {
"className": "py-8 max-w-4xl mx-auto"
},
"children": [
{
"partial": "partials/board/show/_type_renderer.json"
}
]
}
]
},
"modals": [
{
"partial": "partials/board/show/modals/_modal_delete.json"
},
{
"partial": "partials/board/show/modals/_modal_report.json"
},
{
"partial": "partials/board/show/modals/_password_verify_modal.json"
}
]
}