The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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.