3 # Copyright 2015 Tamil s.a.r.l.
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 3 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with Koha; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 my ($verbose, $help, $url, $dir, $short) = (0, 0, '', '.', 1);
32 'verbose' => \
$verbose,
40 pod2usage
( -verbose
=> 2 );
47 $url = C4
::Context
->preference("OPACBaseURL");
49 say "OPACBaseURL syspref isn't defined. You can use --url parameter.";
55 my $sitemapper = Koha
::Sitemapper
->new(
68 =item sitemap.pl [--verbose|--help|--short|--noshort|--url|--dir]
75 sitemap.pl --noshort --dir /home/koha/mylibrary/www
76 sitemap.pl --url opac.myDNSname.org
80 Process all biblio records from a Koha instance and generate Sitemap files
81 complying with this protocol as described on L<http://sitemaps.org>. The goal of
82 this script is to be able to provide to search engines direct access to biblio
83 records. It avoid leaving search engine browsing Koha OPAC and so generating
84 a lot of traffic, and workload, for a bad result.
86 A file name F<sitemapindex.xml> is generated. It contains references to Sitemap
87 multiples files. Each file contains at most 50,000 urls, and is named
90 The files must be stored on Koha OPAC root directory, ie
91 F<<koha-root>/koha-tmpl/>. Place also in this directory a F<robots.txt> file
94 Sitemap: sitemapindex.xml
102 =item B<--url=Koha OPAC base URL>
104 If omitted, OPACBaseURL syspref is used.
106 =item B<--short|noshort>
108 By default, --short. With --short, URL to bib record ends with
109 /bib/biblionumber. With --noshort, URL ends with
110 /cgi-bin/koha/opac-detail.pl?biblionumber=bibnum
114 Directory where to write sitemap files. By default, the current directory.
116 =item B<--verbose|-v>
118 Enable script verbose mode: a message is displayed for each 10,000 biblio
123 Print this help page.