From e13dd00fba075e0dbd237fac0bd709cf121de508 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Wed, 8 Aug 2012 17:40:11 -0400 Subject: [PATCH 1/2] Enable replacing analytics in 404 page --- themes/mongodb/layout.html | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/themes/mongodb/layout.html b/themes/mongodb/layout.html index cdbe66400a3..6726be9f9f5 100644 --- a/themes/mongodb/layout.html +++ b/themes/mongodb/layout.html @@ -222,26 +222,26 @@

{{ _('Navigation') }}

{%- endblock %} +{%- block analytics%} +{%- endblock %} - - - +{%- block marketo %} + + +{%- endblock %} From 972d940aaf3a121c22227b508765af22fe545420 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Fri, 10 Aug 2012 12:45:21 -0400 Subject: [PATCH 2/2] DOCS-375 implement custom 404 page (and related pages) layout.html modified to add logic to alter Google Analytics code depending on whether it's an error page being generated or a normal page. The .htaccess file needs to be dropped in the root directory of the manual (or appended to the one for the site). Sphinx ignores the .htaccess file and does not copy it to the built html directory. --- source/.htaccess | 5 +++++ source/meta/401.txt | 7 +++++++ source/meta/403.txt | 7 +++++++ source/meta/404.txt | 7 +++++++ source/meta/410.txt | 7 +++++++ themes/mongodb/layout.html | 28 ++++++++++++++++------------ 6 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 source/.htaccess create mode 100644 source/meta/401.txt create mode 100644 source/meta/403.txt create mode 100644 source/meta/404.txt create mode 100644 source/meta/410.txt diff --git a/source/.htaccess b/source/.htaccess new file mode 100644 index 00000000000..d4594cab44e --- /dev/null +++ b/source/.htaccess @@ -0,0 +1,5 @@ +# Note: this must be manually copied, sphinx does not process it +ErrorDocument 401 /manual/meta/401.html +ErrorDocument 403 /manual/meta/403.html +ErrorDocument 404 /manual/meta/404.html +ErrorDocument 410 /manual/meta/410.html diff --git a/source/meta/401.txt b/source/meta/401.txt new file mode 100644 index 00000000000..36ba531f2d4 --- /dev/null +++ b/source/meta/401.txt @@ -0,0 +1,7 @@ +:orphan: + +======================= +Authentication Required +======================= + +You must log in to access the URL you requested. diff --git a/source/meta/403.txt b/source/meta/403.txt new file mode 100644 index 00000000000..9e4b03e76c2 --- /dev/null +++ b/source/meta/403.txt @@ -0,0 +1,7 @@ +:orphan: + +============= +Access Denied +============= + +You do not have access to the URL you requested. diff --git a/source/meta/404.txt b/source/meta/404.txt new file mode 100644 index 00000000000..0bdd725c211 --- /dev/null +++ b/source/meta/404.txt @@ -0,0 +1,7 @@ +:orphan: + +============== +File not found +============== + +The URL you requested does not exist or has been removed. diff --git a/source/meta/410.txt b/source/meta/410.txt new file mode 100644 index 00000000000..7ad1fe45799 --- /dev/null +++ b/source/meta/410.txt @@ -0,0 +1,7 @@ +:orphan: + +============ +File Deleted +============ + +The URL you requested has been deleted. diff --git a/themes/mongodb/layout.html b/themes/mongodb/layout.html index 6726be9f9f5..a68b3ba2e88 100644 --- a/themes/mongodb/layout.html +++ b/themes/mongodb/layout.html @@ -222,21 +222,25 @@

{{ _('Navigation') }}

{%- endblock %} -{%- block analytics%} +{%- block analytics %} {%- endblock %} - {%- block marketo %}