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>
我作了簡單的增刪,你認真比較,應該能看出它的變化。
這樣重新打包部署應該就沒有問題了。