Skip to content

Commit

Permalink
add lastmod date
Browse files Browse the repository at this point in the history
  • Loading branch information
jmckenna committed May 6, 2024
1 parent c09fce0 commit b96c803
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions collection/scripts/generate_sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
contact email: [email protected]
Purpose of file: Generate a sitemap.xml file by pointing to a directory containing
JSON-LD files (and subfolders if necessary)
Steps: change the first 2 defines below to point to your local install, then
Steps: change the first 3 defines below to point to your local install, then
execute it at the commandline with:
Syntax: php generate_sitemap.php > sitemap.xml
History: originally created for COINAtlantic catalogue in 2011
*/

define ('JSONLD_ROOT_PATH_DIRECTORY', '/home/apps/odis-arch-git/collection/tempHosting/data-wod');
define ('JSONLD_ROOT_PATH_URL', 'https://raw.githubusercontent.com/iodepo/odis-arch/master/collection/tempHosting/data-wod');
#set how frequently the record is likely to change
# possible values are: always, hourly, daily, weekly, monthly, yearly, never
define ('SITEMAP_CHANGE_FREQUENCY', 'monthly');

$basedir = JSONLD_ROOT_PATH_DIRECTORY;
$baseurl = JSONLD_ROOT_PATH_URL;
Expand All @@ -30,7 +33,7 @@ function printlink($fn)
echo " <url>" . "\n";
echo " <loc>$url</loc>" . "\n";
echo " <lastmod>$currentDate</lastmod>" . "\n";
echo " <changefreq>monthly</changefreq>" . "\n";
echo " <changefreq>".SITEMAP_CHANGE_FREQUENCY."</changefreq>" . "\n";
echo " </url>" . "\n";
return;
}
Expand Down

0 comments on commit b96c803

Please sign in to comment.