Skip to content

Implement custom 404 (and 401,403,410) pages for docs site #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 11, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions source/.htaccess
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions source/meta/401.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:orphan:

=======================
Authentication Required
=======================

You must log in to access the URL you requested.
7 changes: 7 additions & 0 deletions source/meta/403.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:orphan:

=============
Access Denied
=============

You do not have access to the URL you requested.
7 changes: 7 additions & 0 deletions source/meta/404.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:orphan:

==============
File not found
==============

The URL you requested does not exist or has been removed.
7 changes: 7 additions & 0 deletions source/meta/410.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:orphan:

============
File Deleted
============

The URL you requested has been deleted.
42 changes: 23 additions & 19 deletions themes/mongodb/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,26 +222,30 @@ <h3>{{ _('Navigation') }}</h3>
</div>
{%- endblock %}

{%- block analytics %}
<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-7301842-8']);
_gaq.push(['_setDomainName', 'mongodb.org']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-7301842-8']);
_gaq.push(['_setDomainName', 'mongodb.org']);
{%- if (pagename == "meta/401") or (pagename == "meta/403") or (pagename == "meta/404") or (pagename == "meta/410") %}
_gaq.push(['_trackPageview', '/manual/{{pagename}}.html?page=' + document.location.pathname + document.location.search + '&from=' + document.referrer]);
{%- else %}
_gaq.push(['_trackPageview']);
{%- endif %}

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>


<script type="text/javascript">
document.write(unescape("%3Cscript src='" + document.location.protocol + "//munchkin.marketo.net/munchkin.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script>try { mktoMunchkin("017-HGS-593"); } catch(e) {}</script>
{%- endblock %}
{%- block marketo %}
<script type="text/javascript">
document.write(unescape("%3Cscript src='" + document.location.protocol + "//munchkin.marketo.net/munchkin.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script>try { mktoMunchkin("017-HGS-593"); } catch(e) {}</script>
{%- endblock %}
</body>
</html>