欢迎使用 Apache Maven Fluido 皮肤!
Apache Maven Fluido Skin 是构建在Twitter 的 Bootstrap 2.3.2之上的 Apache Maven 站点皮肤。
提供了一个示例页面来查看实际的皮肤,以及两个完整的站点来显示皮肤配置:一个用于侧边栏布局(默认),另一个用于顶栏布局。
注意:从这个皮肤 1.5 版开始,需要 Velocity 1.7(由 Maven 站点插件 3.5 版使用)。但是在以前的皮肤版本中,它是 Velocity 1.5,它有一些不兼容的地方。如果您需要混合版本,请参阅迁移指南以根据您的特定皮肤和站点插件要求覆盖 Maven 站点插件使用的 Velocity 版本。
用法
要在您的项目中使用此皮肤,请使用站点描述符的site.xml皮肤元素:
<project name="xxx">
[...]
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>1.10.0</version>
</skin>
[...]
</project>顶栏和/或侧栏
皮肤支持不同的布局,启用/禁用左侧边栏菜单和顶栏菜单。用户刚刚在custom.fluidoSkin元素中使用了标志site.xml:
<project name="xxx">
[...]
<custom>
<fluidoSkin>
<topBarEnabled>true</topBarEnabled>
<sideBarEnabled>false</sideBarEnabled>
</fluidoSkin>
</custom>
[...]
</project>这允许用户在 1 中拥有 4 个皮肤!
- 仅侧边栏;
- 仅限顶栏;
- 两侧/顶杆;
- 一个都没有。
默认皮肤设置是选项1。
顶部栏图标
当用户决定启用顶栏时,他们可以在其中插入一个小图标/徽标(通常为 108*20 像素),只需custom.fluidoSkin.topBarIcon在以下位置配置元素site.xml:
<project name="xxx">
[...]
<custom>
<fluidoSkin>
<topBarEnabled>true</topBarEnabled>
<topBarIcon>
<name>Maven Fluido Skin</name>
<alt>Maven Fluido Skin</alt>
<src>/images/topbar-logo.png</src>
<href>/index.html</href>
</topBarIcon>
</fluidoSkin>
</custom>
[...]
</project>TopBarContainerStyle
你可以为你的 topbar 配置 div 容器的 style 属性值
<project name="xxx">
[...]
<custom>
<fluidoSkin>
<topBarEnabled>true</topBarEnabled>
<topBarContainerStyle>width: 90%;</topBarContainerStyle>
</fluidoSkin>
</custom>
[...]
</project>导航栏样式
您可以配置顶部栏导航的样式(因为默认情况下引导程序 2.1.0 不再是黑色)。使用 navbar-inverse 获得黑色。
<project name="xxx">
[...]
<custom>
<fluidoSkin>
<topBarEnabled>true</topBarEnabled>
<navBarStyle>navbar-inverse</navBarStyle>
</fluidoSkin>
</custom>
[...]
</project>配置列类
使用侧边栏时,导航栏默认使用span2类,正文栏使用span10. 为了防止奇怪/丑陋的结果,总和必须是 12。您可以使用以下方法更改:
<project name="xxx">
[...]
<custom>
<fluidoSkin>
<leftColumnClass>span3</leftColumnClass>
<bodyColumnClass>span9</bodyColumnClass>
</fluidoSkin>
</custom>
[...]
</project>谷歌分析
用户可以选择为生成的站点启用Google Analytics :
<project name="xxx"> [...] <googleAnalytics>UA-12345...</googleAnalytics> [...] </project>
默认情况下,forceSSL和anonymizeIp已启用。您可以同时禁用两者,但这在多个国家或地区可能是非法的(例如,由于 GDPR 在欧盟):
<project name="xxx">
[...]
<googleAnalytics>UA-12345...</googleAnalytics>
[...]
<custom>
<fluidoSkin>
<googleAnalytics>
<anonymizeIp>true/false</anonymizeIp>
<forceSSL>true/false</forceSSL>
</googleAnalytics>
</fluidoSkin>
</custom>
[...]
</project>谷歌搜索
用户可以选择为生成的站点启用Google 搜索,要求是:
- 中的
project.url属性pom.xml,除非该custom.fluidoSkin.googleSearch.sitesearch属性设置在 中site.xml:<project name="xxx"> [...] <url>http://maven.apache.org/skins/maven-fluido-skin</url> [...] </project>
- 中的
custom.fluidoSkin.googleSearch元素site.xml:<project name="xxx"> [...] <custom> <fluidoSkin> <googleSearch> <sitesearch/> </googleSearch> </fluidoSkin> </custom> [...] </project>
默认情况下,搜索表单:
- 未启用;添加
custom.fluidoSkin.googleSearch足以启用搜索框。 - 在侧边栏中呈现,如果只有顶栏可用,它将在那里呈现。
外部链接在侧边栏或顶部栏中呈现。当侧边栏和顶部栏都启用时,它们仅在顶部栏中呈现为下拉菜单。
SourceLineNumbers
源代码部分由Google Code Prettify增强,用户可以选择启用行号渲染(默认禁用):
<project name="xxx">
[...]
<custom>
<fluidoSkin>
<sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
</fluidoSkin>
</custom>
[...]
</project>版权类
从1.3.1版本开始,您可以配置版权类:
<project name="xxx">
[...]
<custom>
<fluidoSkin>
<copyrightClass>pull-right</copyrightClass>
</fluidoSkin>
</custom>
[...]
</project>页眉/页脚占位符
此皮肤会将您的自定义页眉/页脚传递给$render.eval()并替换 Velocity 上下文已知的所有变量。
GitHub 功能区
从1.1版开始,fluido-skin 支持GitHub功能区以简化Fork me on GitHub横幅集成。用户必须定义:
custom.fluidoSkin.gitHub.projectId:必填,是GitHub上的项目id,将用于构建项目页面URL;custom.fluidoSkin.gitHub.ribbonOrientation: optional , 是ribbon位置,left/right只接受(left默认);custom.fluidoSkin.gitHub.ribbonColor:可选,为色带颜色,///reddarkblue //green只接受只接受(默认) 。blackorangegrayred<project name="xxx"> [...] <custom> <fluidoSkin> <gitHub> <projectId>apache/maven-skins</projectId> <ribbonOrientation>right</ribbonOrientation> <ribbonColor>black</ribbonColor> </gitHub> </fluidoSkin> </custom> [...] </project>
项目简介
如MojoHaus Maven 插件列表所示,插件生命周期具有不同的状态/阶段:
- 生产
- 预发布
- 沙盒
- 墓地(退役项目)
用户可以根据项目状态(生产除外)配置不同的背景,以保证用户他们没有使用生产就绪软件:
<project name="xxx"> [...] <custom> <fluidoSkin> <profile>(pre-release|sandbox|retired)</profile> </fluidoSkin> </custom> [...] </project>
推特关注按钮
从1.1版本开始,fluido-skin 支持 Twitter关注按钮以简化其集成。用户必须定义:
custom.fluidoSkin.twitter.user:必填,建议关注的推特ID;custom.fluidoSkin.twitter.showUser:可选,必须显示标记用户的标志(false默认情况下);custom.fluidoSkin.twitter.showFollowers:可选,必须显示标记追随者功能区的标志(false默认情况下)。<project name="xxx"> [...] <custom> <fluidoSkin> <twitter> <user>simonetripodi</user> <showUser>true</showUser> <showFollowers>true</showFollowers> </twitter> </fluidoSkin> </custom> [...] </project>默认情况下,它在侧边栏中呈现,如果只有顶栏可用,它将在那里呈现。
Ohloh 小部件
从1.1版本开始,fluido-skin 支持 Ohloh小部件以简化其集成。用户必须定义:
custom.fluidoSkin.ohloh.projectId: required , 是 Ohloh 中的项目标识符(可以是数字 id 或项目名称);custom.fluidoSkin.ohloh.widget: optional,它是必须呈现的小部件类型,允许的值为:users-logo(默认)users-greenusers-redusers-blueusers-grayusers-rainbowusersthin-badgepartner-badgelanguagesfactoidscocomostats<project name="xxx"> [...] <custom> <fluidoSkin> <ohloh> <projectId>3499</projectId> <widget>factoids</widget> </ohloh> </fluidoSkin> </custom> [...] </project>
Ohloh 小部件将始终作为最后一个元素呈现在页脚中
Facebook 喜欢按钮
从1.2版本开始,fluido-skin 支持 Facebook类集成。用户可以定义类似 Facebook SDK 的选项:
custom.fluidoSkin.facebookLike.recommend: optional , 如果设置为trueRecommend按钮将被渲染而不是Likecustom.fluidoSkin.facebookLike.shareButton:可选,如果设置为true共享按钮将被包括在内。custom.fluidoSkin.facebookLike.layout:可选的 facebook 布局,可以是以下之一:standardbutton_count:如果未启用侧边栏,则为默认值buttonbox_count:如果启用了侧边栏,则默认为<project name="xxx"> [...] <custom> <fluidoSkin> <facebookLike> <recommend>true/false</recommend> <shareButton>true/false</shareButton> <layout>box_count</layout> </facebookLike> </fluidoSkin> </custom> [...] </project>
默认情况下,它在侧边栏中呈现,如果只有顶栏可用,它将在那里呈现。
请注意,为了显示 Facebook 点赞按钮
${project.url},必须在pom.xml!
Piwik 网络分析
从1.3.1版本开始,fluido-skin 支持将Piwik 网络分析 跟踪代码插入到生成的页面中。用户必须声明:
custom.fluidoSkin.piwik.piwikUrl: Piwik 安装的 URL,没有协议、前导和尾随斜杠(即没有http://)。custom.fluidoSkin.piwik.idsite: 被跟踪站点的 Piwik 安装中的 ID。<project name="xxx"> [...] <custom> <fluidoSkin> <piwik> <piwikUrl>example.org/piwik</piwikUrl> <idsite>1</idsite> </piwik> </fluidoSkin> </custom> [...] </project>
扁平按钮
从1.3.1版本开始,fluido-skin 支持Flattr 按钮集成。用户必须声明:
custom.fluidoSkin.flattr.thing:必需,Flattr 事物的 ID。这是flattr.com/thing/Flattr 按钮的 URL 部分之后的部分。custom.fluidoSkin.flattr.url: optional , Flattr 事物的 URL。${project.url}必须设置this 或以使按钮出现。(${project.url}默认情况下。)custom.fluidoSkin.flattr.style:可选,Flattr 按钮的样式。large并compact得到支持。(large默认情况下。)<project name="xxx"> [...] <custom> <fluidoSkin> <flattr> <thing>12345/Example-Org</thing> <url>http://example.org/</url> <style>compact</style> </flattr> </fluidoSkin> </custom> [...] </project>默认情况下,它在侧边栏中呈现,如果只有顶栏可用,它将在那里呈现。
跳过生成日期
从版本1.3.1开始,您可以从“由 Apache Maven Doxia 在 <date> 生成”行中跳过生成日期以启用它:
<project name="xxx">
[...]
<custom>
<fluidoSkin>
<skipGenerationDate>true</skipGenerationDate>
</fluidoSkin>
</custom>
[...]
</project>面包屑分隔线
从1.3.1版本开始,您可以配置面包屑分隔符(默认为斜线):
<project name="xxx">
[...]
<custom>
<fluidoSkin>
<breadcrumbDivider>»</breadcrumbDivider>
</fluidoSkin>
</custom>
[...]
</project>致谢
Apache Maven Fluido Skin 包含/重新分发Glyphicons Halflings作为 Twitter 的 Bootstrap 的一部分,在Creative Commons Attribution 3.0 Unported (CC BY 3.0)下发布。



