nutch 1.2 war的二次开发 第一步,重新编写首页

nutch的首页,比较难看,实现了一些基本页面,像baidu一样。你如果像对它进行二次开发的话,你就得读一下源码了,然后进行build.xml 重新打包在tomcat里发布了,当然。这里我已经对它进行了读写哈。

nutch 里的页面,是通过xslt 里编写的,在源码src/web/style/nutch-page.xsl 编写,这里有一个xsl格式的源码。这里你应该要读懂它的基本结构,不然会build.xml失败的。所以你要一步一步的试。

基本结构:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />
<xsl:template match="page">
<html>
<xsl:comment>
This page is automatically generated. Do not edit!
</xsl:comment>
<head>
<!-- page title -->
<title>
<xsl:text>你自己定义的title </xsl:text>
<xsl:value-of select="title" disable-output-escaping="yes" />
</title>
<!-- insert style 插入你的样式 -->
<xsl:copy-of select="document('../include/style.html')" />
<!-- specify icon file 引入js包 -->
<script language="javascript" src="../resources/js/navMore-min.js"></script>
<script src="../resources/js/autoComplete-min.js"></script>
<script src="../resources/js/goso-slide-min.js"></script>
<script src="../resources/js/goso-waterMark-min.js"></script>
<script src="../resources/js/helpers-min.js"></script>
<script language="javascript" src="../resources/js/index.js"></script>

<script type="text/javascript">
<xsl:comment>
function queryfocus() {
search = document.search;
if (search != null) { search.query.focus(); }
}
<xsl:text>// </xsl:text>
</xsl:comment>
</script>
</head>
<body class="homeLink" onLoad="queryfocus();">
<xsl:call-template name="body" />
<xsl:copy-of select="document('../include/footer.html')"/>
</body>
</html>
</xsl:template>
<!-- included menu -->
<xsl:template name="subnavi">

</xsl:template>
<!-- /included menu -->
<!-- included body -->
<xsl:template name="body">
你的body
</xsl:template>
<!-- /included body -->
</xsl:stylesheet>

我作了简单的增删,你认真比较,应该能看出它的变化。

这样重新打包部署应该就没有问题了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值