Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An Ant task to generate a sitemap

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 src
Octocat-spinner-32 test-resources
Octocat-spinner-32 test
Octocat-spinner-32 testlib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.markdown
Octocat-spinner-32 build.properties
Octocat-spinner-32 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.