Add support for multiple versions of the docs

This commit is contained in:
Will Rossiter 2014-11-15 11:50:54 +13:00 committed by Cam Findlay
parent b900339032
commit 269bf31107
5 changed files with 46 additions and 41 deletions

View File

@ -40,7 +40,7 @@ Config::inst()->update('DocumentationViewer', 'check_permission', false);
DocumentationViewer::set_edit_link(
'framework',
'https://github.com/silverstripe/framework/edit/%version%/docs/%lang%/%path%',
'https://github.com/silverstripe/silverstripe-framework/edit/%version%/docs/%lang%/%path%',
array(
'rewritetrunktomaster' => true
)
@ -56,7 +56,7 @@ DocumentationSearch::set_meta_data(array(
'Tags' => 'silverstripe sapphire php framework cms content management system'
));
// Changelogs have heaps of phrases, but are rarely relevant for content searches
// Changelogs have heaps of phrases, but are rarely relevant for content searches
Config::inst()->update('DocumentationSearch', 'boost_by_path', array(
'/^changelog/' => 0.05
));
@ -67,3 +67,4 @@ if(file_exists(BASE_PATH . '/.lucene-index')) {
}

View File

@ -12,6 +12,16 @@ DocumentationManifest:
-
Path: "framework/docs/"
Title: "Framework"
Version: master
Version: "3.1"
Stable: true
DefaultEntity: true
-
Path: "src/framework_3.0/docs/"
Title: "Framework"
Version: "3.0"
DefaultEntity: true
-
Path: "src/framework_2.4/docs/"
Title: "Framework"
Version: "2.4"
DefaultEntity: true

View File

@ -13,57 +13,46 @@ fi
#
# The master branch will checked out by default
# PARAMETERS:
# $1 - module path on github (e.g silverstripe/silverstripe.git)
# $1 - module path on github (e.g silverstripe/sapphire.git)
# $2 - branch name (e.g 3.0)
# $3 - module name (e.g framework)
# $3 - module name (e.g sapphire)
#
#===============================================================================
# Parameters: github path
checkout () {
echo "Checking out $2/$3 from $1"
mkdir -p $dir/src
function checkout {
if [ ! -d $dir/src/$2 ]; then
echo "Cloning git://github.com/$1 into $dir/src/$2"
echo "Cloning $1 "
mkdir $dir/src
cd $dir/src
git clone -q git://github.com/$1 $2
cd ../
git clone --depth=100 -q git://github.com/$1 $2 --quiet
cd $2
git checkout -q origin/master
else
cd $dir/src/$2
git fetch origin
git reset --hard -q
cd ../../
git pull -q origin master
git checkout -q origin/master
fi
if [ $# = 3 ]; then
if [ $# == 3 ]; then
echo "Checking out $2 from $1 into $2_$3"
if [ -d $dir/src/$2_$3 ]; then
cd "$dir/src/$2_$3"
cd $dir/src/$2_$3
else
cp -R "$dir/src/$2" "$dir/src/$2_$3"
cd "$dir/src/$2_$3"
cp -R $dir/src/$2 $dir/src/$2_$3
cd $dir/src/$2_$3
fi
git reset --hard origin/$3 -q
cd ../../
git reset --hard -q
git checkout $3 -q
git pull -q
else
echo "Checking out $2 from $1 into $2"
fi
}
# core
checkout 'silverstripe/silverstripe-framework.git' 'framework' 'master'
checkout 'silverstripe/silverstripe-framework.git' 'framework' '3.1'
checkout 'silverstripe/silverstripe-framework.git' 'framework' '3.0'
checkout 'silverstripe/silverstripe-framework.git' 'framework' '2.4'
checkout 'silverstripe/silverstripe-framework.git' 'framework' '2.3'
# core modules with docs
checkout 'silverstripe/silverstripe-cms.git' 'cms' '3.0'
# checkout 'silverstripe/silverstripe-docsviewer.git' 'docsviewer'
# checkout 'silverstripe/silverstripe-forum.git' 'forum'
# checkout 'silverstripe/silverstripe-translatable.git' 'translatable'
# checkout 'silverstripe/silverstripe-subsites.git' 'subsites'
# popular labs projects
# checkout 'silverstripe-labs/silverstripe-staticpublisher.git' 'staticpublisher'
echo "Done."
echo "Done."

View File

@ -22,5 +22,10 @@
"config": {
"process-timeout": 600
},
"minimum-stability": "dev"
}
"minimum-stability": "dev",
"scripts": {
"post-update-cmd": [
"./bin/update.sh"
]
}
}

6
composer.lock generated
View File

@ -187,12 +187,12 @@
"source": {
"type": "git",
"url": "https://github.com/silverstripe/silverstripe-docsviewer.git",
"reference": "fbe7c861a58403e6951fd4846cd08716421290b7"
"reference": "1e2737bc5ad60f216c6ab27cbe2ac30d5092cdc6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/silverstripe/silverstripe-docsviewer/zipball/fbe7c861a58403e6951fd4846cd08716421290b7",
"reference": "fbe7c861a58403e6951fd4846cd08716421290b7",
"url": "https://api.github.com/repos/silverstripe/silverstripe-docsviewer/zipball/1e2737bc5ad60f216c6ab27cbe2ac30d5092cdc6",
"reference": "1e2737bc5ad60f216c6ab27cbe2ac30d5092cdc6",
"shasum": ""
},
"require": {