mkdocs-material/src/base.html

260 lines
8.3 KiB
HTML
Raw Normal View History

2016-01-29 01:27:15 +03:00
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<!-- Charset and viewport -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,
user-scalable=no, initial-scale=1, maximum-scale=1" />
<!-- General meta tags -->
{% block htmltitle %}
<!-- Site title -->
{% if page_title %}
<title>{{ page_title }} - {{ site_name }}</title>
2016-02-04 17:03:20 +03:00
{% elif page_description %}
<title>{{ site_name }} - {{ page_description }}</title>
2016-01-29 01:27:15 +03:00
{% else %}
<title>{{ site_name }}</title>
{% endif %}
<!-- Site description -->
{% if page_description %}
<meta name="description" content="{{ page_description }}" />
{% endif %}
<!-- Canonical -->
{% if canonical_url %}
<link rel="canonical" href="{{ canonical_url }}" />
{% endif %}
<!-- Author -->
{% if site_author %}
<meta name="author" content="{{ site_author }}" />
{% endif %}
{% endblock %}
2016-02-10 01:48:01 +03:00
<!-- Open graph tags -->
<meta property="og:url" content="{{ canonical_url }}" />
<meta property="og:title" content="{{ site_name }}"/>
<meta property="og:image"
content="{{ canonical_url }}/{{ base_url }}/{{ config.extra.logo }}" />
2016-01-29 01:27:15 +03:00
<!-- Web application capability on iOS -->
<meta name="apple-mobile-web-app-title" content="{{ site_name }}" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style"
content="black-translucent" />
2016-02-09 23:59:37 +03:00
<!-- Web application icon on iOS -->
{% if config.extra.logo %}
<link rel="apple-touch-icon"
href="{{ base_url }}/{{ config.extra.logo }}">
{% endif %}
2016-01-29 01:27:15 +03:00
<!-- Favicon -->
2016-02-09 23:59:37 +03:00
{% set icon = icon | default('assets/images/favicon.ico') %}
2016-02-04 17:03:20 +03:00
<link rel="shortcut icon" type="image/x-icon"
2016-02-09 23:59:37 +03:00
href="{{ base_url }}/{{ icon }}" />
2016-02-04 17:03:20 +03:00
<link rel="icon" type="image/x-icon"
2016-02-09 23:59:37 +03:00
href="{{ base_url }}/{{ icon }}" />
2016-01-29 01:27:15 +03:00
<!-- Configure icons (placed here to omit issues with subdirectories) -->
<style>
@font-face {
font-family: 'Icon';
src: url('{{ base_url }}/assets/fonts/icon.eot?52m981');
src: url('{{ base_url }}/assets/fonts/icon.eot?#iefix52m981')
format('embedded-opentype'),
url('{{ base_url }}/assets/fonts/icon.woff?52m981')
format('woff'),
url('{{ base_url }}/assets/fonts/icon.ttf?52m981')
format('truetype'),
url('{{ base_url }}/assets/fonts/icon.svg?52m981#icon')
format('svg');
font-weight: normal;
font-style: normal;
}
</style>
2016-01-29 01:27:15 +03:00
<!-- Theme-related stylesheets -->
2016-02-09 14:58:55 +03:00
<link rel="stylesheet" type="text/css"
href="{{ base_url }}/assets/stylesheets/application.css" />
<!-- Configure webfonts -->
{% if config.extra.font != 'none' %}
{% set text = 'Ubuntu' %}
{% if config.extra.font and config.extra.font.text %}
{% set text = config.extra.font.text %}
{% endif %}
{% set code = 'Ubuntu Mono' %}
{% if config.extra.font and config.extra.font.code %}
{% set code = config.extra.font.code %}
{% endif %}
2016-02-17 20:08:11 +03:00
{% set font = text + ':400,700|' + code | replace(' ', '+') %}
<link rel="stylesheet" type="text/css"
href="//fonts.googleapis.com/css?family={{ font }}" />
<style>
body, input {
font-family: '{{ text }}', Helvetica, Arial, sans-serif;
}
pre, code {
font-family: '{{ code }}', 'Courier New', 'Courier', monospace;
}
</style>
{% endif %}
<!-- Custom stylesheets -->
2016-01-29 01:27:15 +03:00
{% for path in extra_css %}
<link rel="stylesheet" type="text/css" href="{{ path }}" />
{% endfor %}
<!-- Custom header -->
{% block extrahead %}{% endblock %}
</head>
<body>
<!--
Sadly the jinja template engine is not very flexible - it doesn't support
regular expressions out-of-the-box. Since there might be a slash at the
end of the repository name, we just do a string comparison and kill it.
-->
{% if repo_name == 'GitHub' %}
{% set repo_id = repo_url | replace('https://github.com/', '') %}
{% if repo_id[-1:] == '/' %}
{% set repo_id = repo_id[:-1] %}
{% endif %}
{% endif %}
2016-01-29 01:27:15 +03:00
<!-- Backdrop -->
<div class="backdrop">
<div class="backdrop-paper"></div>
</div>
<!-- State toggles -->
<input class="toggle" type="checkbox" id="toggle-drawer" />
<input class="toggle" type="checkbox" id="toggle-search" />
<!-- Overlay for expanded drawer -->
<label class="toggle-button overlay" for="toggle-drawer"></label>
<!-- Header -->
<header class="header">
{% include "header.html" %}
</header>
<!-- Main content -->
<main class="main">
<!--
This is a nasty hack that checks whether the content contains a
h1 headline. If it does, the variable h1 is set to true. This is
necessary for correctly rendering the table of contents which is
embedded into the navigation and the actual headline.
-->
2016-02-09 14:58:55 +03:00
{% set h1 = "\x3ch1 id=" in content %}
2016-01-29 01:27:15 +03:00
<!-- Drawer with navigation -->
<div class="drawer">
{% include "drawer.html" %}
</div>
<!-- Article -->
<article class="article">
<div class="wrapper">
<!-- Headline -->
{% if not h1 %}
{% if page_title %}
<h1>{{ page_title }}</h1>
{% else %}
<h1>{{ site_name }}</h1>
{% endif %}
2016-01-29 01:27:15 +03:00
{% endif %}
<!-- Article content -->
{{ content }}
<!-- Copyright and theme information -->
<aside class="copyright" role="note">
{% if copyright %}
{{ copyright }} &ndash;
{% endif %}
Documentation built with
<a href="http://www.mkdocs.org" target="_blank">MkDocs</a>
using the
<a href="http://squidfunk.github.io/mkdocs-material/"
2016-01-29 01:27:15 +03:00
target="_blank">
2016-02-09 14:58:55 +03:00
Material
2016-01-29 01:27:15 +03:00
</a>
theme.
</aside>
<!-- Footer -->
{% block footer %}
<footer class="footer">
{% include "footer.html" %}
</footer>
{% endblock %}
</article>
</div>
<!-- Search results -->
<div class="results" role="status" aria-live="polite">
<div class="scrollable">
<div class="wrapper">
<div class="meta"></div>
<div class="list"></div>
</div>
</div>
</div>
</main>
<!-- Modernizr -->
<script src="{{ base_url }}/assets/javascripts/modernizr.js"></script>
<!-- Theme-related and custom javascripts -->
<script>
var base_url = '{{ base_url }}';
var repo_id = '{{ repo_id }}';
</script>
<script src="{{ base_url }}/assets/javascripts/application.js"></script>
{% for path in extra_javascript %}
<script src="{{ path }}"></script>
{% endfor %}
<!-- Google Analytics -->
{% if google_analytics %}
<script>
(function(i,s,o,g,r,a,m){
i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||
[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;
m.parentNode.insertBefore(a,m)
})(window, document,
'script', '//www.google-analytics.com/analytics.js', 'ga');
2016-01-29 01:27:15 +03:00
/* General initialization */
2016-01-29 01:27:15 +03:00
ga('create', '{{ google_analytics[0] }}', '{{ google_analytics[1] }}');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
/* Track outbound links */
var buttons = document.querySelectorAll('a');
Array.prototype.map.call(buttons, function(item) {
if (item.host != window.location.host) {
item.addEventListener('click', function() {
var action = item.getAttribute('data-action') || 'follow';
ga('send', 'event', 'outbound', action, item.href);
});
}
});
2016-01-29 01:27:15 +03:00
</script>
{% endif %}
</body>
</html>