Repository: hbase Updated Branches: refs/heads/master f80691e58 -> 4d31779dd
HBASE-11533 AsciiDoctor POC Addendum 2 to fix redirects during site generation Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4d31779d Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4d31779d Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4d31779d Branch: refs/heads/master Commit: 4d31779dd79ca814255e732747f1bcc373623f26 Parents: f80691e Author: Misty Stanley-Jones <[email protected]> Authored: Mon Jan 19 18:21:09 2015 +1000 Committer: Misty Stanley-Jones <[email protected]> Committed: Mon Jan 19 18:21:09 2015 +1000 ---------------------------------------------------------------------- hbase-common/src/main/resources/.htaccess | 8 -------- pom.xml | 21 ++++++++++++++++++++- src/main/site/resources/.htaccess | 8 ++++++++ src/main/site/resources/book/.empty | 1 + 4 files changed, 29 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/4d31779d/hbase-common/src/main/resources/.htaccess ---------------------------------------------------------------------- diff --git a/hbase-common/src/main/resources/.htaccess b/hbase-common/src/main/resources/.htaccess deleted file mode 100644 index 5bfc3aa..0000000 --- a/hbase-common/src/main/resources/.htaccess +++ /dev/null @@ -1,8 +0,0 @@ -# Redirect HTML-multi version of the book to HTML-single -# Rule added 2015-1-12 -- can be removed in 6 months -Redirect /book/ /book.html - -# Redirect replication URL to the right section of the book -# Rule added 2015-1-12 -- can be removed in 6 months -Redirect /replication.html /book.html#cluster_replication - http://git-wip-us.apache.org/repos/asf/hbase/blob/4d31779d/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 3aef6d7..d0aa389 100644 --- a/pom.xml +++ b/pom.xml @@ -877,7 +877,7 @@ <outputDirectory>${basedir}/target/site</outputDirectory> <resources> <resource> - <directory>${basedir}/hbase-common/src/main/resources/</directory> + <directory>${basedir}/src/main/site/resources/</directory> <includes> <include>.htaccess</include> </includes> @@ -885,6 +885,25 @@ </resources> </configuration> </execution> + <!-- needed to make the redirect above work --> + <execution> + <id>copy-empty-book-dir</id> + <goals> + <goal>copy-resources</goal> + </goals> + <phase>post-site</phase> + <configuration> + <outputDirectory>${basedir}/target/site</outputDirectory> + <resources> + <resource> + <directory>${basedir}/src/main/site/resources/</directory> + <includes> + <include>book/**</include> + </includes> + </resource> + </resources> + </configuration> + </execution> </executions> <configuration> <escapeString>\</escapeString> http://git-wip-us.apache.org/repos/asf/hbase/blob/4d31779d/src/main/site/resources/.htaccess ---------------------------------------------------------------------- diff --git a/src/main/site/resources/.htaccess b/src/main/site/resources/.htaccess new file mode 100644 index 0000000..20bf651 --- /dev/null +++ b/src/main/site/resources/.htaccess @@ -0,0 +1,8 @@ + +# Redirect replication URL to the right section of the book +# Rule added 2015-1-12 -- can be removed in 6 months +Redirect permanent /replication.html /book.html#_cluster_replication + +# Redirect old page-per-chapter book sections to new single file. +RedirectMatch permanent ^/book/(.*)\.html$ /book.html#$1 +RedirectMatch permanent ^/book/$ /book.html http://git-wip-us.apache.org/repos/asf/hbase/blob/4d31779d/src/main/site/resources/book/.empty ---------------------------------------------------------------------- diff --git a/src/main/site/resources/book/.empty b/src/main/site/resources/book/.empty new file mode 100644 index 0000000..5513814 --- /dev/null +++ b/src/main/site/resources/book/.empty @@ -0,0 +1 @@ +# This directory is here so that we can have rewrite rules in our .htaccess to maintain old links. Otherwise we fall under some top-level niceness redirects because we have a file named book.html.
