文档更改Home

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

从版本 109.1
Yang Sheng编辑
在2025-02-42,00:20上
修改评论: 该版本没有评论
到版本
Yang Sheng编辑
在2025-02-42,00:24上
修改评论: 该版本没有评论

摘要

细节

页面属性
内容
... ... @@ -16,12 +16,13 @@
16 16  (((
17 17  === 近期更新 ===
18 18  
19 -
20 -
21 21  {{velocity}}
22 22  ## 定义一级链接列表
23 23  #set($topLevelPages = ["Home", "AI For Service", "AIO知识库", "脚本&自动化"])
24 24  
23 +## 定义需要忽略的页面标题列表
24 +#set($ignoreTitles = ["页面管理", "脚本&自动化"])
25 +
25 25  ## 输出结果
26 26  #foreach($topPage in $topLevelPages)
27 27   = $topPage =
... ... @@ -32,29 +32,31 @@
32 32   #set($query = $query.setLimit(3))
33 33   #set($recentDocs = $query.execute())
34 34  
35 - #if($recentDocs.isEmpty())
36 - No recent updates.
37 - #else
38 - #foreach($docFullName in $recentDocs)
39 - #set($document = $xwiki.getDocument($docFullName))
40 - #if($document)
41 - #set($docTitle = $document.getDisplayTitle())
42 - ## 仅当用户有看权限时显示
43 - #if($xwiki.hasAccessLevel('view', $xcontext.user, $document.getFullName()))
36 + #set($hasUpdates = false)
37 + #foreach($docFullName in $recentDocs)
38 + #set($document = $xwiki.getDocument($docFullName))
39 + #if($document)
40 + #set($docTitle = $document.getDisplayTitle())
41 + ## 仅当用户有查看权限时显示
42 + #if($xwiki.hasAccessLevel('view', $xcontext.user, $document.getFullName()))
43 + ## 页面标题是否在忽略列表中
44 + #if(!$ignoreTitles.contains($docTitle))
44 44   #if($docTitle == '')
45 45   #set($docTitle = "Untitled Document")
46 46   #end
47 47   * [[${docTitle}>>${document.getExternalURL('view')}]]
49 + #set($hasUpdates = true)
48 48   #end
49 49   #end
50 50   #end
51 51   #end
54 +
55 + #if(!$hasUpdates)
56 + 此版块近期没有更新。
57 + #end
52 52  #end
53 53  {{/velocity}}
54 54  
55 -
56 -)))
57 -
58 58  (% class="col-xs-12 col-sm-6" %)
59 59  (((
60 60  === 相关链接 ===