@ProviderType
public interface SeoTags
It can be adapted from any Page
's content that is of sling:resourceType
wcm/foundation/components/basicpage/v1/basicpage
.
Usage:
page.getContentResource().adaptTo(SeoTags.class)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PN_CANONICAL_URL
The property name of the custom canonical url property.
|
static java.lang.String |
PN_ROBOTS_TAGS
The property name of the robots tags property.
|
Modifier and Type | Method and Description |
---|---|
@NotNull java.util.Map<java.util.Locale,java.lang.String> |
getAlternateLanguages()
Returns a
Map of alternate language urls of the current Resource. |
@Nullable java.lang.String |
getCanonicalUrl()
Returns the canonical url of the current Resource.
|
@NotNull java.util.List<java.lang.String> |
getRobotsTags()
Returns a
List of robots tags to be provided to search engine crawlers. |
boolean |
isCanonical()
Returns true when the current Resource belongs to a canonical page.
|
static final java.lang.String PN_ROBOTS_TAGS
static final java.lang.String PN_CANONICAL_URL
boolean isCanonical()
The default implementation returns true reflecting the assumption that, if not otherwise specified, each page is canonical.
@Nullable @Nullable java.lang.String getCanonicalUrl()
This uses the SitemapLinkExternalizer
implementation to ensure the same canonical url as
it is used in Sitemap(s) is returned. The format of the url is complete, meaning it contains authority, path and extension.
This may return null
when the externalization fails.
@NotNull @NotNull java.util.Map<java.util.Locale,java.lang.String> getAlternateLanguages()
Map
of alternate language urls of the current Resource.
An alternate language link exists for each language copy of the Page
, when the
Page
is included in a Sitemap. It uses the
SitemapLinkExternalizer
to ensure the same canonical urls as in Sitemap(s) are returned.
The format of the url is complete, meaning it contains authority, path and extension.
@NotNull @NotNull java.util.List<java.lang.String> getRobotsTags()
List
of robots tags to be provided to search engine crawlers.
The collection is curated and may only return tags that are allowed to appear together.
List
of robots tagsCopyright © 2010 - 2023 Adobe. All Rights Reserved