文档更改Home

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

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

摘要

细节

页面属性
内容
... ... @@ -10,11 +10,10 @@
10 10  
11 11  == ==
12 12  
13 -
14 -
15 15  (% class="col-xs-12 col-sm-6" %)
16 16  (((
17 17  === 近期更新 ===
16 +
18 18  {{velocity}}
19 19  ## 定义一级链接列表
20 20  #set($topLevelPages = ["Home", "AI For Service", "AIO知识库", "脚本&自动化"])
... ... @@ -24,6 +24,10 @@
24 24  
25 25  ## 输出结果
26 26  #foreach($topPage in $topLevelPages)
26 + ## 初始化标志和输出变量
27 + #set($hasUpdates = false)
28 + #set($output = "")
29 +
27 27   ## 查询每个一级链接下所有子页面的最近更新
28 28   #set($hqlQuery = "select doc.fullName from XWikiDocument doc where doc.fullName like :spacePattern and doc.fullName not like '%:WebPreferences' and doc.fullName not like '%:WebHome' and doc.fullName not like '%:WebSearch' and doc.fullName not like '%:WebRss' and doc.fullName not like '%:WebStatistics' order by doc.date desc")
29 29   #set($query = $services.query.hql($hqlQuery))
... ... @@ -31,7 +31,6 @@
31 31   #set($query = $query.setLimit(3))
32 32   #set($recentDocs = $query.execute())
33 33  
34 - #set($hasUpdates = false)
35 35   #foreach($docFullName in $recentDocs)
36 36   #set($document = $xwiki.getDocument($docFullName))
37 37   #if($document)
... ... @@ -43,26 +43,22 @@
43 43   #if($docTitle == '')
44 44   #set($docTitle = "Untitled Document")
45 45   #end
46 - #if(!$hasUpdates)
47 - = $topPage =
48 - #set($hasUpdates = true)
49 - #end
50 - * [[${docTitle}>>${document.getExternalURL('view')}]]
48 + ## 添加到输出
49 + #set($output = "$output* [[${docTitle}>>${document.getExternalURL('view')}]]\n")
50 + #set($hasUpdates = true)
51 51   #end
52 52   #end
53 53   #end
54 54   #end
55 +
56 + ## 仅在有更新时显示标题和内容
57 + #if($hasUpdates)
58 + = $topPage =
59 + $output
60 + #end
55 55  #end
56 56  {{/velocity}}
57 57  
58 -
59 -)))
60 60  
61 -(% class="col-xs-12 col-sm-6" %)
62 -(((
63 -=== 相关链接 ===
64 -
65 -(% style="font-size:14px" %)[[北区AIO项目看板(IPV6访问)>>http://nas.nicebro.fun:57567||rel="noopener noreferrer" target="_blank"]]
66 -)))
67 -
68 68  
66 +)))