From 55cd7c6fa02fec5fa7a43279eccb5cabc6f7a961 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 12 Dec 2016 13:22:28 +1300 Subject: [PATCH] Update docsviewer to include versioned "documentation index" page * Add rewrite rules for previous routes * Add version to matched routing parameters --- .htaccess | 3 +++ app/_config/routes.yml | 2 +- composer.lock | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.htaccess b/.htaccess index 431b96a0b..11cc6d4c2 100644 --- a/.htaccess +++ b/.htaccess @@ -51,6 +51,9 @@ ErrorDocument 500 /assets/error-500.html # Redirect any version > 3.4 to 3 branch RewriteRule ^en/3\.[5-9]/(.*)?$ /en/3/$1 [R=301,L] + # Redirect old index links to the current version (via another redirect rule) + RewriteRule ^en/all\/?$ / [R=301,L] + # DokuWiki rewrite rules: Need to happen before other rules in order to redirect /doku.php?id= # to /pagename, which can then be matched by the legacy rewrite rules further down RewriteCond %{QUERY_STRING} ^(\bid\b=([^&]*)&?(.*)?) diff --git a/app/_config/routes.yml b/app/_config/routes.yml index a46f38a24..0587a162a 100644 --- a/app/_config/routes.yml +++ b/app/_config/routes.yml @@ -10,4 +10,4 @@ Director: 'dev/buildcache/$Action': 'RebuildStaticCacheTask' 'dev': 'DevelopmentAdmin' '': '->en/' - '$Lang/$Action': 'DocumentationViewer' \ No newline at end of file + '$Lang/$Version/$Action': 'DocumentationViewer' diff --git a/composer.lock b/composer.lock index 62f1af650..ec8987951 100644 --- a/composer.lock +++ b/composer.lock @@ -554,16 +554,16 @@ }, { "name": "silverstripe/docsviewer", - "version": "2.0.0-beta4", + "version": "2.0.0-beta5", "source": { "type": "git", "url": "https://github.com/silverstripe/silverstripe-docsviewer.git", - "reference": "40d70a0b32f1ea63594238ab25aba9d9397416b7" + "reference": "ded5432ec0d6e2183c395ef4a98e7695c89d5112" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silverstripe/silverstripe-docsviewer/zipball/40d70a0b32f1ea63594238ab25aba9d9397416b7", - "reference": "40d70a0b32f1ea63594238ab25aba9d9397416b7", + "url": "https://api.github.com/repos/silverstripe/silverstripe-docsviewer/zipball/ded5432ec0d6e2183c395ef4a98e7695c89d5112", + "reference": "ded5432ec0d6e2183c395ef4a98e7695c89d5112", "shasum": "" }, "require": { @@ -591,7 +591,7 @@ "documentation", "silverstripe" ], - "time": "2016-12-04 21:22:45" + "time": "2016-12-12 00:54:31" }, { "name": "silverstripe/dynamodb",