mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-10-22 15:05:50 +00:00
Add support for multiple versions of the docs
This commit is contained in:
parent
b900339032
commit
269bf31107
@ -40,7 +40,7 @@ Config::inst()->update('DocumentationViewer', 'check_permission', false);
|
|||||||
|
|
||||||
DocumentationViewer::set_edit_link(
|
DocumentationViewer::set_edit_link(
|
||||||
'framework',
|
'framework',
|
||||||
'https://github.com/silverstripe/framework/edit/%version%/docs/%lang%/%path%',
|
'https://github.com/silverstripe/silverstripe-framework/edit/%version%/docs/%lang%/%path%',
|
||||||
array(
|
array(
|
||||||
'rewritetrunktomaster' => true
|
'rewritetrunktomaster' => true
|
||||||
)
|
)
|
||||||
@ -67,3 +67,4 @@ if(file_exists(BASE_PATH . '/.lucene-index')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,6 +12,16 @@ DocumentationManifest:
|
|||||||
-
|
-
|
||||||
Path: "framework/docs/"
|
Path: "framework/docs/"
|
||||||
Title: "Framework"
|
Title: "Framework"
|
||||||
Version: master
|
Version: "3.1"
|
||||||
Stable: true
|
Stable: true
|
||||||
DefaultEntity: 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
|
||||||
|
@ -13,57 +13,46 @@ fi
|
|||||||
#
|
#
|
||||||
# The master branch will checked out by default
|
# The master branch will checked out by default
|
||||||
# PARAMETERS:
|
# 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)
|
# $2 - branch name (e.g 3.0)
|
||||||
# $3 - module name (e.g framework)
|
# $3 - module name (e.g sapphire)
|
||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Parameters: github path
|
# Parameters: github path
|
||||||
checkout () {
|
function checkout {
|
||||||
echo "Checking out $2/$3 from $1"
|
|
||||||
mkdir -p $dir/src
|
|
||||||
|
|
||||||
if [ ! -d $dir/src/$2 ]; then
|
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
|
cd $dir/src
|
||||||
git clone -q git://github.com/$1 $2
|
git clone --depth=100 -q git://github.com/$1 $2 --quiet
|
||||||
cd ../
|
cd $2
|
||||||
|
git checkout -q origin/master
|
||||||
else
|
else
|
||||||
cd $dir/src/$2
|
cd $dir/src/$2
|
||||||
git fetch origin
|
git pull -q origin master
|
||||||
git reset --hard -q
|
git checkout -q origin/master
|
||||||
cd ../../
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $# = 3 ]; then
|
if [ $# == 3 ]; then
|
||||||
|
echo "Checking out $2 from $1 into $2_$3"
|
||||||
|
|
||||||
if [ -d $dir/src/$2_$3 ]; then
|
if [ -d $dir/src/$2_$3 ]; then
|
||||||
cd "$dir/src/$2_$3"
|
cd $dir/src/$2_$3
|
||||||
else
|
else
|
||||||
cp -R "$dir/src/$2" "$dir/src/$2_$3"
|
cp -R $dir/src/$2 $dir/src/$2_$3
|
||||||
cd "$dir/src/$2_$3"
|
cd $dir/src/$2_$3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git reset --hard origin/$3 -q
|
git reset --hard -q
|
||||||
cd ../../
|
git checkout $3 -q
|
||||||
|
git pull -q
|
||||||
|
else
|
||||||
|
echo "Checking out $2 from $1 into $2"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# core
|
# 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' '3.0'
|
||||||
checkout 'silverstripe/silverstripe-framework.git' 'framework' '2.4'
|
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."
|
@ -22,5 +22,10 @@
|
|||||||
"config": {
|
"config": {
|
||||||
"process-timeout": 600
|
"process-timeout": 600
|
||||||
},
|
},
|
||||||
"minimum-stability": "dev"
|
"minimum-stability": "dev",
|
||||||
|
"scripts": {
|
||||||
|
"post-update-cmd": [
|
||||||
|
"./bin/update.sh"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
6
composer.lock
generated
6
composer.lock
generated
@ -187,12 +187,12 @@
|
|||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/silverstripe/silverstripe-docsviewer.git",
|
"url": "https://github.com/silverstripe/silverstripe-docsviewer.git",
|
||||||
"reference": "fbe7c861a58403e6951fd4846cd08716421290b7"
|
"reference": "1e2737bc5ad60f216c6ab27cbe2ac30d5092cdc6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/silverstripe/silverstripe-docsviewer/zipball/fbe7c861a58403e6951fd4846cd08716421290b7",
|
"url": "https://api.github.com/repos/silverstripe/silverstripe-docsviewer/zipball/1e2737bc5ad60f216c6ab27cbe2ac30d5092cdc6",
|
||||||
"reference": "fbe7c861a58403e6951fd4846cd08716421290b7",
|
"reference": "1e2737bc5ad60f216c6ab27cbe2ac30d5092cdc6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user