From 71efff9ed500786d1e737eff27491a41e03725ca Mon Sep 17 00:00:00 2001 From: Chris Cho Date: Mon, 15 Nov 2021 17:53:12 -0500 Subject: [PATCH] DOCSP-19480: add meta redirect for overlapping version Java driver docs --- .gitignore | 6 ++++++ .../themes/mongodb/layouts/partials/header.html | 6 +++--- .../layouts/partials/header/metaRedirect.html | 12 ++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 reference/themes/mongodb/layouts/partials/header/metaRedirect.html diff --git a/.gitignore b/.gitignore index d39d50c..0f9a418 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,9 @@ hugo* # security-sensitive files *.gpg + +# vim temporary files +*.swp + +# hugo lock files +*.hugo_build.lock diff --git a/reference/themes/mongodb/layouts/partials/header.html b/reference/themes/mongodb/layouts/partials/header.html index 65fc394..71025f5 100644 --- a/reference/themes/mongodb/layouts/partials/header.html +++ b/reference/themes/mongodb/layouts/partials/header.html @@ -7,6 +7,9 @@ {{.Title}} {{- partial "assets/css.html" . -}} + + {{- partial "header/metaRedirect.html" . -}} + @@ -25,6 +28,3 @@
- {{ if ( and ( findRE ".*mongo-java-driver/4.3/.+" .URL ) ( not ( findRE ".*/apidocs/.*" .URL )) ( not ( findRE ".*/driver-scala/.*" .URL )) (not ( findRE ".*/driver-reactive/.*" .URL ))) }} - {{- partial "header/newSiteNotice.html" . -}} - {{ end }} diff --git a/reference/themes/mongodb/layouts/partials/header/metaRedirect.html b/reference/themes/mongodb/layouts/partials/header/metaRedirect.html new file mode 100644 index 0000000..9685f45 --- /dev/null +++ b/reference/themes/mongodb/layouts/partials/header/metaRedirect.html @@ -0,0 +1,12 @@ +{{ if ( and ( findRE ".*mongo-java-driver/4.4/.+" .URL ) ( not ( findRE ".*/apidocs/.*" .URL )) ( not ( findRE ".*/driver-scala/.*" .URL )) (not ( findRE ".*/driver-reactive/.*" .URL ))) }} + + + +{{ end }} + +{{ if ( and ( findRE ".*mongo-java-driver/4.3/.+" .URL ) ( not ( findRE ".*/apidocs/.*" .URL )) ( not ( findRE ".*/driver-scala/.*" .URL )) (not ( findRE ".*/driver-reactive/.*" .URL ))) }} + + + +{{ end }} +