NAME
Web::Sitemap::Url - Sitemap URL representation
SYNOPSIS
use Web::Sitemap;
$sm = Web::Sitemap->new(%args);
# will produce Web::Sitemap::Url objects from strings
$sm->add(['/blog/1', '/blog/2']);
# will produce Web::Sitemap::Url objects from hashes (more configurable)
$sm->add([
{
loc => '/blog/3',
changefreq => 'daily',
},
{
loc => '/blog/4',
mobile => 1,
}
]);
DESCRIPTION
This is a simple representation of a sitemap URL. It's used internally by Web::Sitemap and is not meant to be used explcitly. It is what each entry of $sitemap->add
will be turned into for the XML generation.
Hash configuration in Web::Sitemap::add
If a sitemap entry is specified as a string, it inherits as much as possible from Web::Sitemap.
Passing a hash allows for overriding global sitemap settings and adding a couple more.
loc
URL location, just like the one that would be passed in a string version. Required.
loc_prefix
Same as in "new" in Web::Sitemap
mobile
Same as in "new" in Web::Sitemap
changefreq
Will be inserted into
<changefreq>
XML node.images
A list of images. See "Support for Google images format" in Web::Sitemap for details.