Skip to content

Commit

Permalink
Merge pull request #151 from tractorcow/pulls/simple-branching
Browse files Browse the repository at this point in the history
API Simplify branches for docs to major versions only
  • Loading branch information
robbieaverill authored Dec 4, 2016
2 parents 6553bf1 + d530e7b commit f10d4e7
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 76 deletions.
26 changes: 16 additions & 10 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,20 @@ ErrorDocument 500 /assets/error-500.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^framework/main\.php
RewriteRule ^sapphire/?(.*) https://docs.silverstripe.org/framework/$1 [R=301,L]

# Rewrite framework to the new base url
RewriteCond %{REQUEST_URI} ^/?framework/en/
RewriteRule ^framework/en/(.*)$ /en/$1 [R=301,NC,QSA,L]

# Docs in /contributing are version agnostic, and should always point to latest
RewriteCond %{REQUEST_URI} !(4.0)
RewriteRule ^(.*)/(.*)/contributing/?(.*)?$ /$1/4.0/contributing/$3 [R=301,L]
RewriteCond %{REQUEST_URI} !(4)
RewriteRule ^(.*)/(.*)/contributing/?(.*)?$ /$1/4/contributing/$3 [R=301,L]

# Redirect 4.0 docs to 4 (new major version)
RewriteRule ^en/4\.0/(.*)?$ /en/4/$1 [R=301,L]

# Redirect any version > 3.4 to 3 branch
RewriteRule ^en/3\.[5-9]/(.*)?$ /en/3/$1 [R=301,L]

# DokuWiki rewrite rules: Need to happen before other rules in order to redirect /doku.php?id=<pagename>
# to /pagename, which can then be matched by the legacy rewrite rules further down
Expand Down Expand Up @@ -128,7 +134,7 @@ ErrorDocument 500 /assets/error-500.html
RewriteRule ^(.*)/installation/windows-pi/?$ /$1/getting_started/installation/other_installation_options/windows_platform_installer [R=301,L]
RewriteCond %{REQUEST_URI} !(3.0|2.4)
RewriteRule ^(.*)/installation/windows-wamp/?$ /$1/getting_started/installation/windows [R=301,L]

RewriteCond %{REQUEST_URI} !(3.0|2.4)
RewriteRule ^(.*)/misc/coding-conventions/?$ /$1/getting_started/coding_conventions [R=301,L]
RewriteCond %{REQUEST_URI} !(3.0|2.4)
Expand All @@ -152,16 +158,16 @@ ErrorDocument 500 /assets/error-500.html

RewriteCond %{REQUEST_URI} !en/2.4/topics/reference/requirements
RewriteRule ^en/2.4/topics/reference/requirements/?$ /en/2.4/reference/requirements [R=301,L]
#
#
RewriteCond %{REQUEST_URI} !(3.0|2.4)
RewriteRule ^(.*)/reference/aspects/?$ /$1/developer_guides/extending/aspects [R=301,L]
#
#
RewriteCond %{REQUEST_URI} !(3.0|2.4)
RewriteRule ^(.*)/reference/cms-architecture/?$ /$1/developer_guides/customising_the_admin_interface/cms_architecture [R=301,L]

RewriteCond %{REQUEST_URI} !en/developer_guides/customising_the_admin_interface/reference/cms-architecture
RewriteRule ^en/developer_guides/customising_the_admin_interface/reference/cms-architecture/?$ /en/developer_guides/customising_the_admin_interface/cms_architecture [R=301,L]
#
#
RewriteCond %{REQUEST_URI} !(3.0|2.4)
RewriteRule ^(.*)/reference/grid-field/?$ /$1/developer_guides/forms/field_types/gridfield [R=301,L]
RewriteCond %{REQUEST_URI} !(3.0|2.4)
Expand Down Expand Up @@ -294,7 +300,7 @@ ErrorDocument 500 /assets/error-500.html
RewriteRule ^(.*)/tutorials/2-extending-a-basic-site/?$ /$1/tutorials/extending-a-basic-site [R=301,L]
#
RewriteRule ^(.*)/tutorials/3-forms/?$ /$1/tutorials/forms [R=301,L]
#
#
RewriteCond %{REQUEST_URI} !(3.0|2.4)
RewriteRule ^(.*)/tutorials/4-site-search/?$ /$1/tutorials/site_search [R=301,L]
RewriteCond %{REQUEST_URI} !(3.0|2.4)
Expand All @@ -304,7 +310,7 @@ ErrorDocument 500 /assets/error-500.html
RewriteRule ^(.*)/tutorials/5-dataobject-relationship-management/?$ /$1/tutorials/dataobject_relationship_management [R=301,L]
RewriteCond %{REQUEST_URI} !(3.0|2.4)
RewriteRule ^(.*)/tutorials/5-dataobject-relationship-management/?$ /$1/tutorials/dataobject-relationship-management [R=301,L]

RewriteCond %{REQUEST_URI} !(3.|2.)
RewriteRule ^(.*)/getting_started/coding_conventions/?$ /$1/contributing/coding_conventions [R=301,L]

Expand Down Expand Up @@ -348,7 +354,7 @@ ErrorDocument 500 /assets/error-500.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.(css|gif|ico|jpg|js|png|swf|txt)$
RewriteRule .* framework/main.php?url=%1&%{QUERY_STRING} [L]

</IfModule>

ErrorDocument 404 /assets/error-404.html
Expand Down
22 changes: 1 addition & 21 deletions app/_config/docs-repositories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,4 @@ RefreshMarkdownTask:
-
- silverstripe/silverstripe-framework
- framework
- "3.4"
-
- silverstripe/silverstripe-framework
- framework
- "3.3"
-
- silverstripe/silverstripe-framework
- framework
- "3.2"
-
- silverstripe/silverstripe-framework
- framework
- "3.1"
-
- silverstripe/silverstripe-framework
- framework
- "3.0"
-
- silverstripe/silverstripe-framework
- framework
- "2.4"
- "3"
24 changes: 22 additions & 2 deletions app/_config/docsviewer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,59 @@ DocumentationManifest:
-
Path: "assets/src/framework_master/docs/"
Title: "Framework"
Version: "4.0"
VersionTitle: "4.x"
Version: "4"
Branch: "master"
DefaultEntity: true
-
Path: "assets/src/framework_3/docs/"
Title: "Framework"
VersionTitle: "3.x"
Version: "3"
Branch: "3"
Stable: true
DefaultEntity: true
-
Path: "assets/src/framework_3.4/docs/"
Title: "Framework"
VersionTitle: "3.4"
Version: "3.4"
Branch: "3.4"
Stable: true
Archived: true
DefaultEntity: true
-
Path: "assets/src/framework_3.3/docs/"
Title: "Framework"
VersionTitle: "3.3"
Version: "3.3"
Branch: "3.3"
Archived: true
DefaultEntity: true
-
Path: "assets/src/framework_3.2/docs/"
Title: "Framework"
VersionTitle: "3.3"
Version: "3.2"
Archived: true
DefaultEntity: true
-
Path: "assets/src/framework_3.1/docs/"
Title: "Framework"
VersionTitle: "3.1"
Version: "3.1"
Archived: true
DefaultEntity: true
-
Path: "assets/src/framework_3.0/docs/"
Title: "Framework"
VersionTitle: "3.0"
Version: "3.0"
Archived: true
DefaultEntity: true
-
Path: "assets/src/framework_2.4/docs/"
Title: "Framework"
VersionTitle: "2.4"
Version: "2.4"
Archived: true
DefaultEntity: true
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"require": {
"ext-gd": "*",
"ext-mbstring": "*",
"silverstripe/docsviewer": "dev-master",
"silverstripe/docsviewer": "^2.0@beta",
"silverstripe/framework": "^3.2",
"silverstripe/toolbar": "^4.2",
"silverstripe/dynamodb": "^1.1",
Expand All @@ -23,8 +23,5 @@
"process-timeout": 600
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {

}
"prefer-stable": true
}
71 changes: 38 additions & 33 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f10d4e7

Please sign in to comment.