Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69731 - website/public_html/beta/common/code
From: dnljms_at_[hidden]
Date: 2011-03-08 17:37:01


Author: danieljames
Date: 2011-03-08 17:36:59 EST (Tue, 08 Mar 2011)
New Revision: 69731
URL: http://svn.boost.org/trac/boost/changeset/69731

Log:
Incorporate the version of boost into the documentation page titles.

A minor improvement for search engines and their users.

Text files modified:
   website/public_html/beta/common/code/boost_archive.php | 8 +++++++-
   website/public_html/beta/common/code/boost_filter_basic.php | 2 +-
   website/public_html/beta/common/code/boost_filter_boost_book_basic.php | 2 +-
   website/public_html/beta/common/code/boost_filters.php | 11 +++++++++++
   4 files changed, 20 insertions(+), 3 deletions(-)

Modified: website/public_html/beta/common/code/boost_archive.php
==============================================================================
--- website/public_html/beta/common/code/boost_archive.php (original)
+++ website/public_html/beta/common/code/boost_archive.php 2011-03-08 17:36:59 EST (Tue, 08 Mar 2011)
@@ -244,8 +244,14 @@
 // General purpose render callbacks.
 
 function boost_archive_render_callbacks($content, $params) {
+ $version_title =
+ str_replace('_', ' ',
+ preg_replace('@(?<=\d)_(?=\d)@', '.',
+ ucwords($params['version'])));
+
     $charset = $params['charset'] ? $params['charset'] : 'us-ascii';
- $title = $params['title'] ? 'Boost C++ Libraries - '.$params['title'] : 'Boost C++ Libraries';
+ $title = $params['title'] ? "$params[title] - $version_title" : 'Boost C++ Libraries';
+
 
     $head = <<<HTML
 <meta http-equiv="Content-Type" content="text/html; charset=${charset}" />

Modified: website/public_html/beta/common/code/boost_filter_basic.php
==============================================================================
--- website/public_html/beta/common/code/boost_filter_basic.php (original)
+++ website/public_html/beta/common/code/boost_filter_basic.php 2011-03-08 17:36:59 EST (Tue, 08 Mar 2011)
@@ -17,7 +17,7 @@
         $is_xhtml = preg_match('@<!DOCTYPE[^>]*xhtml_at_i', $match[0][0]);
         $tag_end = $is_xhtml ? '/>' : '>';
 
- echo substr($text, 0, $match[0][1]);
+ echo alter_title($params, substr($text, 0, $match[0][1]));
         echo '<link rel="icon" href="/favicon.ico" type="image/ico"'.$tag_end;
         echo '<link rel="stylesheet" type="text/css" href="/style-v2/section-basic.css"'.$tag_end;
         echo $match[0][0];

Modified: website/public_html/beta/common/code/boost_filter_boost_book_basic.php
==============================================================================
--- website/public_html/beta/common/code/boost_filter_boost_book_basic.php (original)
+++ website/public_html/beta/common/code/boost_filter_boost_book_basic.php 2011-03-08 17:36:59 EST (Tue, 08 Mar 2011)
@@ -17,7 +17,7 @@
     $pos2 = strpos($text, '<body', $pos1);
     $pos3 = strpos($text, '>', $pos2) + 1;
     $pos4 = strpos($text, '<div class="spirit-nav">', $pos3);
- echo substr($text, 0, $pos1);
+ echo alter_title($params, substr($text, 0, $pos1));
     echo '<link rel="icon" href="/favicon.ico" type="image/ico"/>';
     echo '<link rel="stylesheet" type="text/css" href="/style-v2/section-basic.css"/>';
     echo substr($text, $pos1, $pos3 - $pos1);

Modified: website/public_html/beta/common/code/boost_filters.php
==============================================================================
--- website/public_html/beta/common/code/boost_filters.php (original)
+++ website/public_html/beta/common/code/boost_filters.php 2011-03-08 17:36:59 EST (Tue, 08 Mar 2011)
@@ -9,6 +9,17 @@
  * HTML processing functions
  */
 
+function alter_title($params, $text)
+{
+ $version_title =
+ str_replace('_', ' ',
+ preg_replace('@(?<=\d)_(?=\d)@', '.',
+ ucwords($params['version'])));
+
+ return str_replace('</title>',
+ " - $version_title</title>", $text);
+}
+
 function html_init(&$params)
 {
     preg_match('@text/html; charset=([^\s"\']+)@i',$params['content'],$charset);


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