Web::Sitemap::Url - Sitemap URL representation
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, } ]);
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.
$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
changefreq
Will be inserted into <changefreq> XML node.
<changefreq>
images
A list of images. See "Support for Google images format" in Web::Sitemap for details.
To install Web::Sitemap, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Web::Sitemap
CPAN shell
perl -MCPAN -e shell install Web::Sitemap
For more information on module installation, please visit the detailed CPAN module installation guide.