文档更改Home

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

从版本 69.1
Yang Sheng编辑
在2025-02-36,01:34上
修改评论: 该版本没有评论
到版本
Yang Sheng编辑
在2025-02-42,17:53上
修改评论: 该版本没有评论

摘要

细节

页面属性
内容
... ... @@ -10,25 +10,38 @@
10 10  
11 11  == ==
12 12  
13 -
14 -
15 15  (% class="col-xs-12 col-sm-6" %)
16 16  (((
17 17  === 近期更新 ===
18 18  
19 -{{velocity wiki="false"}}
20 -{{notifications count="5" useUserPreferences="false" displayOwnEvents="true" wikis="$services.wiki.currentWikiId"/}}
21 -{{/velocity}}
17 +{{velocity}}
18 +## 定义一级页面列表
19 +#set($topLevelPages = ["Knowledge", "AI", "Automatic"])
22 22  
21 +## 遍历每个一级页面
22 +#foreach($topPage in $topLevelPages)
23 + ## 查询每个一级页面下最近更新的5个页面(按日期倒序排列)
24 + #set($hqlQuery = "select doc.fullName from XWikiDocument doc where doc.fullName like :spacePattern and doc.name != 'WebPreferences' order by doc.date desc")
25 + #set($query = $services.query.hql($hqlQuery))
26 + #set($query = $query.bindValue("spacePattern", "${topPage}.%"))
27 + #set($query = $query.setLimit(5)) ## 限制结果为5条
28 + #set($recentDocs = $query.execute())
23 23  
24 -
25 -)))
30 + ## 如果找到近期更新的页面
31 + #if($recentDocs.size() > 0)
32 + ## 显示一级页面的标题
33 + ==== $topPage ====
26 26  
27 -(% class="col-xs-12 col-sm-6" %)
28 -(((
29 -=== 相关链接 ===
35 + ## 遍历并展示找到的页面
36 + #foreach($docFullName in $recentDocs)
37 + #set($document = $xwiki.getDocument($docFullName))
38 + * [[${document.getDisplayTitle()}>>${document.getExternalURL('view')}]] (最后更新: $datetool.format("yyyy-MM-dd HH:mm", $document.getDate()))
39 + #end
30 30  
31 -(% style="font-size:14px" %)[[北区AIO项目看板>>http://nas.nicebro.fun:57666||rel="noopener noreferrer" target="_blank"]]
32 -)))
41 +
42 + #end
43 +#end
44 +{{/velocity}}
33 33  
34 34  
47 +)))