如何从 docbook 源创建 sitemap.xml

How to create sitemap.xml from docbook source

我需要从我的 docbook 源中生成标准 Google acceptable format 中的 sitemap.xml。我目前正在使用 gradle 来支持构建过程。

是否有现成的工具可以在构建过程中自动生成 sitemap.xml?

来自Using Ant from Gradle is seams to be possible as there is an Apache Ant Task for generating a XML Sitemap. Read the manual at GitHub,了解使用详情。

<target name="generate_sitemap" description="generates the sitemap">
    <taskdef classname="uk.co.arjones.ant.task.Sitemap" name="sitemap"></taskdef>
    <sitemap url="http://organisation.org" gzip="yes" lastmod="now" destdir="${BUILD_DIR}">
        <fileset dir="${BUILD_DIR}">
            <include name="**.docbook"></include>
            <include name="**.dbx"></include>
            <exclude name="google*"></exclude>
        </fileset>
    </sitemap>
</target>