Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
An Ant task to generate a sitemap
Java
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
src/uk/co/arjones/ant/task lastmod should accept 'now', not 'today'
test-resources
test/uk/co/arjones/ant/task
testlib
.gitignore build jar with version number
.travis.yml Test multiple JDK's
LICENSE
README.markdown
build.properties
build.xml

README.markdown

ant-task-sitemap

This provides an Ant task to create an XML Sitemap, as used by search engines.

SYNOPSIS

<target name="generate_sitemap" description="generates the sitemap">
    <taskdef name="sitemap" classname="uk.co.arjones.ant.task.Sitemap" />
    <sitemap url="http://andrew-jones.com" destdir="${BUILD_DIR}" lastmod="now" gzip="yes">
        <fileset dir="${BUILD_DIR}">
            <include name="**.htm"/>
            <include name="**.html"/>
            <exclude name="google*"/>
        </fileset>
    </sitemap>
</target>

DESCRIPTION

I use Ant to package more than Java, including some static websites. Using this task, I can automatically generate an XML Sitemap.

PARAMETERS

Attribute Description Required
destdir Where we write the sitemap to. Yes
gzip Produce a gzip sitemap? No - default is "false"
index The index page of the website, which should just be written as the URL. This is a regex. index.*
lastmod If specified, we can try to generate a lastmod entry for the file. By passing in now, we will write the lastmod as the time when we build. By passing in fromfile, we will take the last modified time of the file. Don't write lastmod time.
url The URL of the website. Yes

PARAMETERS SPECIFIED AS NESTED ELEMENTS

Attribute Description Required
fileset Where should we look for files to add to the sitemap? This is the same as any other FileSet. Yes

INSTALL

Download the latest jar from GitHub and put it in your class path.

You will also need SitemapGen4j on your path.

TODO

  • Implement change frequency
  • Implement priority
  • Generate text sitemap
  • Generate ROR sitemap

Build status

Build Status

Something went wrong with that request. Please try again.