文档更改Home

Yang Sheng 于 2025-02-42,18:57 最后修改

从版本 202.1
Yang Sheng编辑
在2025-02-42,18:40上
修改评论: 该版本没有评论
到版本
Yang Sheng编辑
在2025-02-42,18:53上
修改评论: 该版本没有评论

摘要

细节

页面属性
内容
... ... @@ -64,7 +64,7 @@
64 64   #set($query = $query.setLimit(5))
65 65   #set($recentDocs = $query.execute())
66 66  
67 -
67 + ----
68 68   ==== $topPage ====
69 69   #if($recentDocs.size() > 0)
70 70   #foreach($docFullName in $recentDocs)
... ... @@ -74,15 +74,24 @@
74 74   #if($title == '' || $title == $null)
75 75   #set($title = $document.getName())
76 76   #end
77 -
78 - #set($fullPath = $docFullName.replaceAll("\\.", " > "))
79 79  
80 - * [[${fullPath} >> ${document.getExternalURL('view')}]] (最后更新: $datetool.format("yyyy-MM-dd HH:mm", $document.getDate()))
78 + #set($pathParts = $docFullName.split("\\.")) ## 分割路径
79 + #set($displayPath = "")
80 + #if($pathParts.size() > 2)
81 + ## 提取路径中的二级页面和后续部分
82 + #set($displayPath = $pathParts[1])
83 + #foreach($part in $pathParts.subList(2, $pathParts.size() - 1))
84 + #set($displayPath = "${displayPath}.${part}")
85 + #end
86 + #end
87 +
88 + ## 如果路径解析出有效内容,显示路径和标题
89 + * [[${displayPath}.${title}>>${document.getExternalURL('view')}]] (最后更新: $datetool.format("yyyy-MM-dd HH:mm", $document.getDate()))
81 81   #end
82 82   #else
83 83   **此分类暂无内容**
84 84   #end
85 -
94 + ----
86 86   #end
87 87  #end
88 88  {{/velocity}}