Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73676 - website/public_html/beta/common/code
From: dnljms_at_[hidden]
Date: 2011-08-11 16:59:05


Author: danieljames
Date: 2011-08-11 16:59:04 EDT (Thu, 11 Aug 2011)
New Revision: 73676
URL: http://svn.boost.org/trac/boost/changeset/73676

Log:
Website: Add noindex to quickbook and directory pages.
Added:
   website/public_html/beta/common/code/boost_filter_qbk.php (contents, props changed)
Text files modified:
   website/public_html/beta/common/code/boost_archive.php | 19 +++++++++++--------
   1 files changed, 11 insertions(+), 8 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-08-11 16:59:04 EDT (Thu, 11 Aug 2011)
@@ -102,7 +102,8 @@
     // Choose filter to use
 
     $info_map = array_merge($content_map, array(
- array('@.*@','@[.](txt|py|rst|jam|v2|bat|sh|xml|toyxml|qbk)$@i','text','text/plain'),
+ array('@.*@','@[.](txt|py|rst|jam|v2|bat|sh|xml|toyxml)$@i','text','text/plain'),
+ array('@.*@','@[.](qbk|quickbook)$@i','qbk','text/plain'),
         array('@.*@','@[.](c|h|cpp|hpp)$@i','cpp','text/plain'),
         array('@.*@','@[.]png$@i','raw','image/png'),
         array('@.*@','@[.]gif$@i','raw','image/gif'),
@@ -245,18 +246,19 @@
 
 function boost_archive_render_callbacks($content, $params) {
     $version_title =
- str_replace('_', ' ',
- preg_replace('@(?<=\d)_(?=\d)@', '.',
- ucwords($params['version'])));
+ str_replace('_', ' ',
+ preg_replace('@(?<=\d)_(?=\d)@', '.',
+ ucwords($params['version'])));
 
     $charset = $params['charset'] ? $params['charset'] : 'us-ascii';
     $title = $params['title'] ? "$params[title] - $version_title" : 'Boost C++ Libraries';
 
+ $head = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=${charset}\" />\n";
 
- $head = <<<HTML
-<meta http-equiv="Content-Type" content="text/html; charset=${charset}" />
-<title>${title}</title>
-HTML;
+ if (!empty($params['noindex'])
+ $head .= "<meta name=\"robots\" content=\"noindex\">\n";
+
+ $head .= "<title>${title}</title>";
 
     return Array(
         'head' => $head,
@@ -271,6 +273,7 @@
     $title = htmlentities("Index listing for $params[key]");
 
     $params['title'] = $title;
+ $params['noindex'] = true;
     
     $content = "<h3>$title</h3>\n<ul>\n";
 

Added: website/public_html/beta/common/code/boost_filter_qbk.php
==============================================================================
--- (empty file)
+++ website/public_html/beta/common/code/boost_filter_qbk.php 2011-08-11 16:59:04 EDT (Thu, 11 Aug 2011)
@@ -0,0 +1,25 @@
+<?php
+/*
+ Copyright 2005-2008 Redshift Software, Inc.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+require_once(dirname(__FILE__).'/boost_filter_text.php');
+
+function qbk_filter($params) {
+ $params['title'] = htmlentities($params['key']);
+ $params['noindex'] = true;
+
+ display_template($params['template'],
+ boost_archive_render_callbacks(qbk_filter_content($params), $params));
+}
+
+function qbk_filter_content($params)
+{
+ return
+ "<h3>".htmlentities($params['key'])."</h3>\n".
+ "<pre>\n".
+ encoded_text($params, 'qbk').
+ "</pre>\n";
+}


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