Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75720 - website/public_html/live
From: dnljms_at_[hidden]
Date: 2011-11-29 04:21:06


Author: danieljames
Date: 2011-11-29 04:21:03 EST (Tue, 29 Nov 2011)
New Revision: 75720
URL: http://svn.boost.org/trac/boost/changeset/75720

Log:
Website: Add the library list to the sitemap.
Text files modified:
   website/public_html/live/sitemap.xml.php | 30 ++++++++++++++++++++----------
   1 files changed, 20 insertions(+), 10 deletions(-)

Modified: website/public_html/live/sitemap.xml.php
==============================================================================
--- website/public_html/live/sitemap.xml.php (original)
+++ website/public_html/live/sitemap.xml.php 2011-11-29 04:21:03 EST (Tue, 29 Nov 2011)
@@ -5,6 +5,7 @@
     require_once(dirname(__FILE__) . '/common/code/boost_libraries.php');
 ?>
 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+
 <?php
 
 function xmlentities($text) {
@@ -14,23 +15,32 @@
         $text);
 }
 
-$libs = USE_SERIALIZED_INFO ?
- unserialize(file_get_contents(dirname(__FILE__) . '/doc/libraries.txt')) :
- new boost_libraries(dirname(__FILE__) . '/doc/libraries.xml');
-
-$base_url = "http://$_SERVER[HTTP_HOST]/doc/libs/release";
+function echo_sitemap_url($loc, $priority, $freq) {
+ $loc_xml = xmlentities("http://$_SERVER[HTTP_HOST]/$loc");
 
-foreach ($libs->get() as $lib) {
- $loc_xml = xmlentities($lib['documentation']);
     echo <<<EOL
 <url>
-<loc>$base_url/$loc_xml</loc>
-<priority>1.0</priority>
-<changefreq>daily</changefreq>
+<loc>$loc_xml</loc>
+<priority>$priority</priority>
+<changefreq>$freq</changefreq>
 </url>
 
 EOL;
 }
 
+// Library list
+
+echo_sitemap_url("doc/libs/", '1.0', 'daily');
+
+// Library 'home pages'
+
+$libs = USE_SERIALIZED_INFO ?
+ unserialize(file_get_contents(dirname(__FILE__) . '/doc/libraries.txt')) :
+ new boost_libraries(dirname(__FILE__) . '/doc/libraries.xml');
+
+foreach ($libs->get() as $lib) {
+ echo_sitemap_url("doc/libs/release/$lib[documentation]", '1.0', 'daily');
+}
+
 ?>
 </urlset>
\ No newline at end of file


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk