java.lang.Object
com.aoapps.ant.tasks.SeoJavadocFilter
Filters javadocs for search engine optimization. Performs the following transformations:
Note: This task should be performed before ZipTimestampMerge
in order to have correct content to be able
to maintain timestamps.
- Adds Canonical URLs to each page.
-
Adds
<meta name="robots" content="noindex, nofollow">
to selective pages. SeegetRobotsHeader(java.io.File, org.apache.commons.compress.archivers.zip.ZipArchiveEntry, org.apache.commons.io.function.IOSupplier, java.util.Map, java.lang.Iterable)
. - rel="nofollow" is added to all links matching the configured nofollow and follow prefixes. This defaults to Java SE, Java EE, and Jakarta EE apidocs.
All existing ZIP entry timestamps are preserved.
This does not have any direct Ant dependencies. If only using this class, it is permissible to exclude the ant dependencies.
- Author:
- AO Industries, Inc.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The value used to match any URL forSeoJavadocFilterTask.setNofollow(java.lang.String)
orSeoJavadocFilterTask.setFollow(java.lang.String)
. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
filterJavadocJar
(File javadocJar, String apidocsUrl, Iterable<String> nofollow, Iterable<String> follow) Filters a single JAR file with the transformations described in this class header.
-
Field Details
-
ANY_URL
The value used to match any URL forSeoJavadocFilterTask.setNofollow(java.lang.String)
orSeoJavadocFilterTask.setFollow(java.lang.String)
.- See Also:
-
-
Method Details
-
filterJavadocJar
public static void filterJavadocJar(File javadocJar, String apidocsUrl, Iterable<String> nofollow, Iterable<String> follow) throws IOException Filters a single JAR file with the transformations described in this class header.- Parameters:
javadocJar
- SeeSeoJavadocFilterTask.setBuildDirectory(java.lang.String)
apidocsUrl
- SeeSeoJavadocFilterTask.setProjectUrl(java.lang.String)
andSeoJavadocFilterTask.setSubprojectSubpath(java.lang.String)
nofollow
- SeeSeoJavadocFilterTask.setNofollow(java.lang.String)
follow
- SeeSeoJavadocFilterTask.setFollow(java.lang.String)
- Throws:
IOException
-