Skip to content
This repository has been archived by the owner on Feb 27, 2020. It is now read-only.

Commit

Permalink
Merge pull request #4 from Metaswitch/theming
Browse files Browse the repository at this point in the history
Theming
  • Loading branch information
rkd-msw committed Feb 7, 2015
2 parents a3c06e3 + 6cd276f commit 293fc06
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 2 deletions.
96 changes: 96 additions & 0 deletions custom_theme/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% block htmltitle %}
<title>{{ page_title }}</title>
{% endblock %}

{# CSS #}
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>

<link rel="stylesheet" href="{{ base_url }}/css/theme.css" type="text/css" />
<link rel="stylesheet" href="{{ base_url }}/css/theme_extra.css" type="text/css" />
<link rel="stylesheet" href="{{ base_url }}/css/highlight.css">
{%- for path in extra_css %}
<link href="{{ path }}" rel="stylesheet">
{%- endfor %}

<script>
// Current page data
var mkdocs_page_name = "{{ current_page.input_path.replace('.md', '') }}"
</script>

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
<script type="text/javascript" src="{{ base_url }}/js/highlight.pack.js"></script>
<script src="{{ base_url }}/js/theme.js"></script>
{%- for path in extra_javascript %}
<script src="{{ path }}"></script>
{%- endfor %}

<style>
body {font-size: 90%;}
pre, code {font-size: 100%;}
h3, h4, h5, h6 {color: #2980b9; font-weight: 300}
</style>
{%- block extrahead %} {% endblock %}
</head>

<body class="wy-body-for-nav" role="document">

<div class="wy-grid-for-nav">

{# SIDE NAV, TOGGLES ON MOBILE #}
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-nav-search">
<a href="{{ homepage_url }}" class="icon icon-home"> {{ site_name }}</a>
{% include "searchbox.html" %}
</div>

<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
{% include "toc.html" %}
</div>
&nbsp;
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

{# MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="icon icon-reorder"></i>
<a href="{{ homepage_url }}">{{ project }}</a>
</nav>

{# PAGE CONTENT #}
<div class="wy-nav-content">
<div class="rst-content">
{% include "breadcrumbs.html" %}
<div role="main">
<div class="section">
{{ content }}
</div>
</div>
{%- block footer %}
{% include "footer.html" %}
{% endblock %}
</div>
</div>

</section>

</div>

<div class="rst-versions" role="note" style="cursor: pointer">
<span class="rst-current-version" data-toggle="rst-current-version">
{% if repo_name == 'GitHub' %}
<a class="icon icon-github" style="float: left; color: #fcfcfc"> GitHub</a>
{% elif repo_name == 'Bitbucket' %}
<a class="icon icon-bitbucket" style="float: left; color: #fcfcfc"> BitBucket</a>
{% endif %}
</span>
</div>
</body>
</html>
17 changes: 17 additions & 0 deletions custom_theme/breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="{{ homepage_url }}">Docs</a> &raquo;</li>
<li>{{ current_page.title }}</li>
<li class="wy-breadcrumbs-aside">
{% if repo_url %}
{% if repo_name == 'GitHub' %}
<a href="{{ repo_url }}/issues" class="icon icon-github">
Problems with these docs? Tell us on GitHub!</a>
{% elif repo_name == 'Bitbucket' %}
<a href="{{ repo_url }}" class="icon icon-bitbucket"> Edit on BitBucket</a>
{% endif %}
{% endif %}
</li>
</ul>
<hr/>
</div>
11 changes: 11 additions & 0 deletions custom_theme/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<footer>
<hr/>

<div role="contentinfo">
<p>
<!-- Copyright etc -->
</p>
</div>

Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
7 changes: 7 additions & 0 deletions custom_theme/searchbox.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
6 changes: 4 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
site_name: Clearwater
site_name: Clearwater Docs Home
repo_url: https://github.com/Metaswitch/clearwater-readthedocs
pages:
# Overview:
- ['index.md', 'Home']
Expand Down Expand Up @@ -69,6 +70,7 @@ pages:
- ['Running_the_live_tests.md', 'Testing', 'Running the live tests']

theme: readthedocs
theme_dir: "custom_theme"
include_search: true
use_directory_urls: false
markdown_extensions: [sane_lists, wikilinks, admonition]
markdown_extensions: [sane_lists, admonition]

0 comments on commit 293fc06

Please sign in to comment.