2
0
mirror of https://github.com/boostorg/website.git synced 2026-01-19 16:52:15 +00:00

Update site to use new build sub-site.

Updated redirects, removed now unused filter, added some notes about
directories that need to be set up.
This commit is contained in:
Daniel James
2014-11-02 22:21:55 +00:00
parent 824ab181c2
commit 8b28506bdf
8 changed files with 21 additions and 106 deletions

1
.gitignore vendored
View File

@@ -1,5 +1,6 @@
*.pyc
/common/code/boost_config_local.php
/doc/archives
/build
/data/
/nbproject/

View File

@@ -70,3 +70,6 @@ RewriteRule ^tools(/.*)?$ doc/tools$1 [R=permanent,L]
RewriteRule ^wiki/?$ http://svn.boost.org/trac/boost [R,L]
# The license file. (This link was never correct, but it's common enough to require a redirect).
RewriteRule ^LICENSE-1.0$ LICENSE_1_0.txt [R=permanent,L]
########## Other redirects
RewriteRule ^b2/?$ /build/ [R=permanent,L]

View File

@@ -1,7 +1,7 @@
RewriteEngine On
RewriteBase /boost-build2
RewriteRule ^doc/html/bbv2/advanced/(.*)$ doc/html/bbv2/overview/$1 [R,L]
RewriteRule ^(boost-build[.]tar[.]bz2)$ /common/code/boost_download.php/$1 [L]
RewriteRule ^(boost-build[.]zip)$ /common/code/boost_download.php/$1 [L]
RewriteRule ^(.*) /doc/display_build.php/boost-build/boost-build/$1 [L]
RewriteRule ^doc/html/bbv2/advanced/(.*)$ /build/doc/html/bbv2/overview/$1 [R=301,L]
RewriteRule ^(boost-build[.]tar[.]bz2)$ /common/code/boost_download.php/$1 [G]
RewriteRule ^(boost-build[.]zip)$ /common/code/boost_download.php/$1 [G]
RewriteRule ^(.*) /build/$1 [R=301,L]

View File

@@ -1,40 +0,0 @@
<?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)
*/
class BoostFilterBoostBookHtml extends BoostFilters
{
function echo_filtered() {
$this->html_init();
$this->display_template($this->template_params(
$this->boost_book_html_filter_content()));
}
function boost_book_html_filter_content()
{
$text = $this->prepare_html($this->params['content'], true);
$text = substr($text,strpos($text,'<div class="spirit-nav">'));
$text = substr($text,0,strpos($text,'</body>'));
$text = str_replace('<hr>','',$text);
$text = str_replace('<table width="100%">','<table class="footer-table">',$text);
$text = str_replace('<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%">','<table class="footer-table">',$text);
$text = preg_replace(
'@[\s]+(border|cellpadding|cellspacing|width|height|valign|frame|rules|naturalsizeflag|background)=[^\s>]+@i',
'',
$text );
##
for ($i = 0; $i < 8; $i++) {
$text = preg_replace(
'@<img src="[\./a-z]*images/(prev|up|home|next|tip|note|warning|important|caution|sidebar|hint|alert)\.png" alt="([^"]+)"([ /]*)>@Ssm',
'<img src="/gfx/space.png" alt="${2}" class="${1}_image" />',
$text );
}
##
return $text;
}
}

View File

@@ -116,30 +116,6 @@ $params = Array(
'content' => $test_doc
);
$test_boost_book_expected = <<<EOL
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<title>Test Document</title></head>
<body>
<!DOCTYPE html>
<html>
<head>
<title>Test Document</title>
</head>
<body>
<h1>Simple test case for the filters</h1>
<p>For now just test a
<a class="external" href="http://svn.boost.org/trac/boost/">link to an external site</a>,
<a href="/tools/boostbook/">an absolute path</a> and
<a href="../../../development/">a relative path</a>.
</p>
</body>
</html>
EOL;
$test_boost_libs_expected = <<<EOL
<!DOCTYPE html>
@@ -176,7 +152,6 @@ $test_simple_expected = <<<EOL
</html>
EOL;
filter_test('boost_book_html', $params, $test_boost_book_expected);
filter_test('boost_libs', $params, $test_boost_libs_expected);
filter_test('simple', $params, $test_simple_expected);
// TODO: This doesn't work because the filter calls 'virtual', which breaks

View File

@@ -12,6 +12,6 @@ $archive = new BoostArchive(array(
$archive->display_from_archive(
array(
//~ array(path-regex,raw|simple|text|cpp|boost_book_html|boost_libs_html,mime-type),
//~ array(path-regex,raw|simple|text|cpp|boost_libs_html,mime-type),
)
);

View File

@@ -378,6 +378,18 @@ define('UNZIP', 'unzip');
"https://github.com/boostorg/website/blob/master/common/code/boost_config.php">
common/code/boost_config.php</a></tt> file.</p>
</li>
<li>
<p>In order to view the documentation, or the build
sub-site, you'll need to setup the appropriate directories.
<tt>/doc/archives</tt> needs to contain unzipped copies of
the appropriate boost distribution to serve the
documentation. <tt>/build</tt> needs to contain the
<a href="https://github.com/boostorg/build/tree/website"><tt>
website</tt> branch of Boost.Build</a>. Soft links to
another directory can be used here (which is how it's done
on the server).</p>
</li>
</ol>
<h3>Ubuntu setup</h3>

View File

@@ -1,36 +0,0 @@
<?php
require_once(dirname(__FILE__) . '/../common/code/boost.php');
function add_boost_build_analytics($content) {
$analytics = <<<EOS
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2917240-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
</script>
EOS;
return stripos($content, '_uacct = "UA-2917240-2"') !== FALSE ? $content :
str_ireplace('</head>', $analytics.'</head>', $content);
}
$archive = new BoostArchive(array(
'archive_subdir' => false,
'zipfile' => false,
));
$archive->display_from_archive(
array(
//~ array(path-regex,raw|simple|text|cpp|boost_book_html|boost_libs_html,mime-type[,preprocess hook]),
array('@^boost-build/index[.]html$@i','simple','text/html', 'add_boost_build_analytics'),
array('@[.](html|htm)$@i','boost_book_html','text/html')
)
);