1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-23 23:21:00 +01:00

Merge pull request #65 from brendo:issue-63-mkdocs-016-compatible

This commit is contained in:
squidfunk 2016-12-15 16:43:40 +01:00
parent 49020c51ae
commit fe12548f8e
22 changed files with 376 additions and 275 deletions

View File

@ -32,11 +32,12 @@ mkdocs-material-1.0.0-rc.1 (2016-XX-XX)
* Added more detailed documentation on specimen, extensions etc.
* Added a 404.html error page for deployment on GitHub Pages
* Fixed live reload chain in watch mode when saving a template
* Fixed variable references to work with mkdocs 0.16
mkdocs-material-0.2.4 (2016-06-26)
* Fixed improperly set default favicon
* Fixed #33: Protocol relative URL for web fonts doesn't work with file://
* Fixed #33: Protocol relative URL for webfonts doesn't work with file://
* Fixed #34: IE11 on Windows 7 doesn't honor max-width on main tag
* Fixed #35: Add styling for blockquotes
@ -95,4 +96,4 @@ mkdocs-material-0.1.1 (2016-02-11)
mkdocs-material-0.1.0 (2016-02-09)
* Initial release
* Initial release

View File

@ -4,7 +4,7 @@
[![PyPI Downloads][pypi-dl-image]][pypi-dl-link]
[![PyPI Version][pypi-v-image]][pypi-v-link]
A material design theme for [MkDocs](http://www.mkdocs.org).
A material design theme for [MkDocs 0.16](http://www.mkdocs.org).
[![iOS](docs/images/screen.png)](http://squidfunk.github.io/mkdocs-material/)

View File

@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "main.html" %}
{% block content %}
<h1>404 - Not found</h1>
{% endblock %}
{% endblock %}

View File

@ -2801,13 +2801,13 @@ var Application =
* this.field('title', 10)
* this.field('tags', 100)
* this.field('body')
*
*
* this.ref('cid')
*
*
* this.pipeline.add(function () {
* // some custom pipeline function
* })
*
*
* })
*
* @param {Function} config A function that will be called with the new instance
@ -5321,36 +5321,32 @@ var Application =
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*
* Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
var _jsCookie = __webpack_require__(22);
var _jsCookie2 = _interopRequireDefault(_jsCookie);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/*
* Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
/* ----------------------------------------------------------------------------
* Class
* ------------------------------------------------------------------------- */
@ -5404,4 +5400,4 @@ var Application =
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15)))
/***/ }
/******/ ]);
/******/ ]);

View File

@ -24,7 +24,7 @@
;(function(window, document, undefined){
var tests = [];
/**
*
@ -73,7 +73,7 @@
}
};
// Fake some of Object.create so we can force non test results to be non "own" properties.
var Modernizr = function() {};
@ -83,10 +83,10 @@
// Overwrite name so constructor name is nicer :D
Modernizr = new Modernizr();
var classes = [];
/**
* is returns a boolean if the typeof an obj is exactly type.
@ -182,7 +182,7 @@
*/
var docElement = document.documentElement;
/**
* A convenience helper to check if the document we are running in is an SVG document
@ -192,7 +192,7 @@
*/
var isSVG = docElement.nodeName.toLowerCase() === 'svg';
/**
* setClasses takes an array of class names and adds them to the root element
@ -260,7 +260,7 @@
}
})();
// _l tracks listeners for async tests, as well as tests that execute after the initial run
@ -470,7 +470,7 @@
ModernizrProto.addTest = addTest;
});
/**
@ -746,7 +746,7 @@ Detects support for SVG in `<embed>` or `<object>` elements.
*/
var testStyles = ModernizrProto.testStyles = injectElementWithStyles;
/*!
{
"name": "@font-face",
@ -814,11 +814,11 @@ Detects support for SVG in `<embed>` or `<object>` elements.
*/
var omPrefixes = 'Moz O ms Webkit';
var cssomPrefixes = (ModernizrProto._config.usePrefixes ? omPrefixes.split(' ') : []);
ModernizrProto._cssomPrefixes = cssomPrefixes;
/**
@ -852,7 +852,7 @@ Detects support for SVG in `<embed>` or `<object>` elements.
delete modElem.elem;
});
var mStyle = {
style: modElem.elem.style
@ -864,7 +864,7 @@ Detects support for SVG in `<embed>` or `<object>` elements.
delete mStyle.style;
});
/**
* domToCSS takes a camelCase string and converts it to kebab-case
@ -1054,7 +1054,7 @@ Detects support for SVG in `<embed>` or `<object>` elements.
var domPrefixes = (ModernizrProto._config.usePrefixes ? omPrefixes.toLowerCase().split(' ') : []);
ModernizrProto._domPrefixes = domPrefixes;
/**
* fnBind is a super small [bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) polyfill.
@ -1149,7 +1149,7 @@ Detects support for SVG in `<embed>` or `<object>` elements.
// Modernizr.testAllProps('boxSizing')
ModernizrProto.testAllProps = testPropsAll;
/**
* testAllProps determines whether a given CSS property is supported in the browser
@ -1192,7 +1192,7 @@ Detects support for SVG in `<embed>` or `<object>` elements.
return testPropsAll(prop, undefined, undefined, value, skipValueTest);
}
ModernizrProto.testAllProps = testAllProps;
/*!
{
"name": "CSS Supports",
@ -1283,4 +1283,4 @@ Detects support for SVG in `<embed>` or `<object>` elements.
;
})(window, document);
})(window, document);

View File

@ -1,33 +1,47 @@
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1">
{% if page_title %}
<title>{{ page_title }} - {{ site_name }}</title>
{% elif page_description %}
<title>{{ site_name }} - {{ page_description }}</title>
{% else %}
<title>{{ site_name }}</title>
{% endif %}
{% if page_description %}
<meta name="description" content="{{ page_description }}">
{% endif %}
{% if canonical_url %}
<link rel="canonical" href="{{ canonical_url }}">
{% endif %}
{% if site_author %}
<meta name="author" content="{{ site_author }}">
{% endif %}
<meta name="generator" content="mkdocs+mkdocs-material#0.2.1">
<script src="{{ base_url }}/assets/javascripts/modernizr.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono:400">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application.css">
{% for path in extra_css %}
<link rel="stylesheet" href="{{ path }}">
{% endfor %}
{% block site_meta %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1">
{% if config.site_description %}
<meta name="description" content="{{ config.site_description }}">
{% endif %}
{% if page.canonical_url %}
<link rel="canonical" href="{{ page.canonical_url }}">
{% endif %}
{% if config.site_author %}
<meta name="author" content="{{ config.site_author }}">
{% endif %}
{% if config.site_favicon %}
<link rel="shortcut icon" href="{{ base_url }}/{{ config.site_favicon }}">
{% else %}
<link rel="shortcut icon" href="{{ base_url }}/assets/images/favicon.ico">
{% endif %}
<meta name="generator" content="mkdocs+mkdocs-material#0.2.1">
{% endblock %}
{% block htmltitle %}
{% if page.title %}
<title>{{ page.title }} - {{ config.site_name }}</title>
{% elif config.site_description %}
<title>{{ config.site_name }} - {{ config.site_description }}</title>
{% else %}
<title>{{ config.site_name }}</title>
{% endif %}
{% endblock %}
{% block libs %}
<script src="{{ base_url }}/assets/javascripts/modernizr.js"></script>
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono:400">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application.css">
{% for path in extra_css %}
<link rel="stylesheet" href="{{ path }}">
{% endfor %}
{% endblock %}
{%- block extrahead -%}{% endblock %}
</head>
<body>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
@ -37,25 +51,27 @@
<div class="md-container">
<main class="md-main">
<div class="md-main__inner md-grid">
{% set h1 = "\x3ch1 id=" in content %}
{% if nav %}
<div class="md-sidebar md-sidebar--primary" data-md-sidebar="primary">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/nav.html" %}
{% set h1 = "\x3ch1 id=" in page.content %}
{% block site_nav %}
{% if nav %}
<div class="md-sidebar md-sidebar--primary" data-md-sidebar="primary">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/nav.html" %}
</div>
</div>
</div>
</div>
{% endif %}
{% if toc %}
<div class="md-sidebar md-sidebar--secondary" data-md-sidebar="secondary">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/toc.html" %}
{% endif %}
{% if page.toc %}
<div class="md-sidebar md-sidebar--secondary" data-md-sidebar="secondary">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/toc.html" %}
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
{% endblock %}
<div class="md-content">
<article class="md-content__inner md-typeset">
{% block content %}
@ -64,17 +80,15 @@
Edit
</a>
{% endif %}
{{ content }}
{{ page.content }}
{% endblock %}
<hr>
<small class="md-content__copyright">
{% if copyright %}
{{ copyright }} &ndash;
{% if config.copyright %}
{{ config.copyright }} &ndash;
{% endif %}
This document was created with
<a href="http://www.mkdocs.org">
MkDocs
</a>
<a href="http://www.mkdocs.org">MkDocs</a>
and the
<a href="http://squidfunk.github.io/mkdocs-material/">
Material
@ -85,33 +99,47 @@
</div>
</div>
</main>
{% include "partials/footer.html" %}
{% block footer %}
{% include "partials/footer.html" %}
{% endblock %}
</div>
{% for extension in config.markdown_extensions %}
{% if extension == "pymdownx.arithmatex" %}
{% set path = "mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML" %}
<script src="https://cdn.mathjax.org/{{ path }}"></script>
{% block scripts %}
{% for extension in config.markdown_extensions %}
{% if extension == "pymdownx.arithmatex" %}
{% set path = "mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML" %}
<script src="https://cdn.mathjax.org/{{ path }}"></script>
{% endif %}
{% endfor %}
<script src="{{ base_url }}/assets/javascripts/application.js"></script>
<script>
/* Configuration for application */
var config = {
url: {
base: "{{ base_url }}",
}
};
/* Initialize application */
var app = new Application(config);
app.initialize();
</script>
{% for path in extra_javascript %}
<script src="{{ path }}"></script>
{% endfor %}
{% endblock %}
{% block analytics %}
{% if config.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');
ga('create',
'{{ config.google_analytics[0] }}',
'{{ config.google_analytics[1] }}');
ga('send', 'pageview');
</script>
{% endif %}
{% endfor %}
<script src="{{ base_url }}/assets/javascripts/application.js"></script>
<script>
/* Configuration for application */
var config = {
url: {
base: "{{ base_url }}",
},
repo: {
url: "{{ repo_url }}",
icon: "{{ repo_icon }}",
},
storage: window.sessionStorage,
};
/* Initialize application */
var app = new Application(config);
app.initialize();
</script>
{% for path in extra_javascript %}
<script src="{{ path }}"></script>
{% endfor %}
{% endblock %}
</body>
</html>

1
material/main.html Normal file
View File

@ -0,0 +1 @@
{% extends "base.html" %}

View File

@ -1,9 +1,9 @@
<footer class="md-footer">
<div class="md-footer__inner">
{% if previous_page or next_page %}
{% if page.previous_page or page.next_page %}
<nav class="md-footer-nav md-grid">
{% if previous_page %}
<a href="{{ previous_page.url }}" title="{{ previous_page.title }}" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
{% if page.previous_page %}
<a href="{{ page.previous_page.url }}" title="{{ page.previous_page.title }}" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--back md-footer-nav__icon"></i>
</div>
@ -12,19 +12,19 @@
<span class="md-footer-nav__direction">
Previous
</span>
{{ previous_page.title }}
{{ page.previous_page.title }}
</span>
</div>
</a>
{% endif %}
{% if next_page %}
<a href="{{ next_page.url }}" title="{{ next_page.title }}" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
{% if page.next_page %}
<a href="{{ page.next_page.url }}" title="{{ page.next_page.title }}" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
Next
</span>
{{ next_page.title }}
{{ page.next_page.title }}
</span>
</div>
<div class="md-flex__cell md-flex__cell--shrink">

View File

@ -2,7 +2,7 @@
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="{{ homepage_url }}" title="{{ site_name }}" class="md-icon md-header-nav__icon md-header-nav__icon--home">
<a href="{{ nav.homepage.url }}" title="{{ config.site_name }}" class="md-icon md-header-nav__icon md-header-nav__icon--home">
layers
</a>
</div>
@ -13,20 +13,26 @@
</div>
<div class="md-flex__cell md-flex__cell--stretch">
<span class="md-flex__ellipsis md-header-nav__title">
{{ page_title | default(site_name, true) }}
{%- block site_name -%}
{{ page.title | default(config.site_name, true) }}
{% endblock %}
</span>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-header-nav__icon md-header-nav__icon--search" for="search">
search
</label>
{% include "partials/search.html" %}
{%- block search_box -%}
<label class="md-icon md-header-nav__icon md-header-nav__icon--search" for="search">
search
</label>
{% include "partials/search.html" %}
{% endblock %}
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
{% if repo_url %}
{% include "partials/source.html" %}
{% endif %}
{%- block repo -%}
{% if config.repo_url %}
{% include "partials/source.html" %}
{% endif %}
{% endblock %}
</div>
</div>
</div>

View File

@ -22,7 +22,7 @@
</ul>
</nav>
</li>
{% elif nav_item == current_page %}
{% elif nav_item == page %}
<li class="md-nav__item">
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
<label class="md-nav__link md-nav__link--active" for="toc">

View File

@ -1,12 +1,12 @@
<nav class="md-nav md-nav--primary">
<label class="md-nav__title" for="drawer">{{ site_name }}</label>
<label class="md-nav__title" for="drawer">{{ config.site_name }}</label>
<ul class="md-nav__list">
{% for nav_item in nav %}
{% set path = "nav-" + loop.index | string %}
{% include "partials/nav-item.html" %}
{% endfor %}
</ul>
{% if repo_url %}
{% if config.repo_url %}
<div class="md-nav__source">
{% include "partials/source.html" %}
</div>

View File

@ -1,7 +1,7 @@
{% set platform = config.extra.repo_icon or repo_url %}
{% set platform = config.extra.repo_icon or config.repo_url %}
{% if "github" in platform %}
{% set repo_type = "github" %}
{% set repo_icon = "md-source--github" %}
{% set repo_icon = "md-source--github" %}
{% elif "gitlab" in platform %}
{% set repo_type = "gitlab" %}
{% set repo_icon = "md-source--gitlab" %}
@ -12,7 +12,7 @@
{% set repo_type = "" %}
{% set repo_icon = "" %}
{% endif %}
<a href="{{ repo_url }}" title="Go to repository" class="md-source {{ repo_icon }}" data-md-source="{{ repo_type }}">
<a href="{{ config.repo_url }}" title="Go to repository" class="md-source {{ repo_icon }}" data-md-source="{{ repo_type }}">
<div class="md-source__repository">
{{ repo_name }}
</div>

View File

@ -1,4 +1,5 @@
<nav class="md-nav md-nav--secondary">
{% set toc = page.toc %}
{% if h1 %}
{% set toc = (toc | first).children %}
{% endif %}

View File

@ -20,9 +20,9 @@
IN THE SOFTWARE.
-->
{% extends "base.html" %}
{% extends "main.html" %}
<!-- Content block -->
{% block content %}
<h1>404 - Not found</h1>
{% endblock %}
{% endblock %}

View File

@ -24,57 +24,77 @@
<html class="no-js">
<head>
<!-- Charset and viewport -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,
user-scalable=no, initial-scale=1, maximum-scale=1" />
<!-- Block: metatags -->
{% block site_meta %}
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,
user-scalable=no, initial-scale=1, maximum-scale=1" />
<!-- Site title -->
{% if page_title %}
<title>{{ page_title }} - {{ site_name }}</title>
{% elif page_description %}
<title>{{ site_name }} - {{ page_description }}</title>
{% else %}
<title>{{ site_name }}</title>
{% endif %}
<!-- Site description -->
{% if config.site_description %}
<meta name="description" content="{{ config.site_description }}" />
{% endif %}
<!-- Site description -->
{% if page_description %}
<meta name="description" content="{{ page_description }}" />
{% endif %}
<!-- Canonical -->
{% if page.canonical_url %}
<link rel="canonical" href="{{ page.canonical_url }}" />
{% endif %}
<!-- Canonical -->
{% if canonical_url %}
<link rel="canonical" href="{{ canonical_url }}" />
{% endif %}
<!-- Author -->
{% if config.site_author %}
<meta name="author" content="{{ config.site_author }}" />
{% endif %}
<!-- Author -->
{% if site_author %}
<meta name="author" content="{{ site_author }}" />
{% endif %}
<!-- Favicon -->
{% if config.site_favicon %}
<link rel="shortcut icon"
href="{{ base_url }}/{{ config.site_favicon }}">
{% else %}
<link rel="shortcut icon"
href="{{ base_url }}/assets/images/favicon.ico">
{% endif %}
<!-- Generator banner -->
<meta name="generator" content="mkdocs+$theme-name$#$theme-version$" />
<!-- Generator banner -->
<meta name="generator" content="mkdocs+$theme-name$#$theme-version$" />
{% endblock %}
<!-- Modernizr -->
<script src="{{ base_url }}/assets/javascripts/modernizr.js"></script>
<!-- Block: site title -->
{% block htmltitle %}
{% if page.title %}
<title>{{ page.title }} - {{ config.site_name }}</title>
{% elif config.site_description %}
<title>{{ config.site_name }} - {{ config.site_description }}</title>
{% else %}
<title>{{ config.site_name }}</title>
{% endif %}
{% endblock %}
<!-- Web fonts -->
<link rel="stylesheet" type="text/css"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700" />
<link rel="stylesheet" type="text/css"
href="https://fonts.googleapis.com/css?family=Roboto+Mono:400" />
<link rel="stylesheet" type="text/css"
href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<!-- Block: JavaScript libraries -->
{% block libs %}
<script src="{{ base_url }}/assets/javascripts/modernizr.js"></script>
{% endblock %}
<!-- Theme-related stylesheets -->
<link rel="stylesheet" type="text/css"
href="{{ base_url }}/assets/stylesheets/application.css" />
<!-- Block: webfonts and stylesheets -->
{% block styles %}
<link rel="stylesheet" type="text/css"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700" />
<link rel="stylesheet" type="text/css"
href="https://fonts.googleapis.com/css?family=Roboto+Mono:400" />
<link rel="stylesheet" type="text/css"
href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<!-- Custom stylesheets -->
{% for path in extra_css %}
<link rel="stylesheet" type="text/css" href="{{ path }}" />
{% endfor %}
<!-- Theme-related stylesheets -->
<link rel="stylesheet" type="text/css"
href="{{ base_url }}/assets/stylesheets/application.css" />
<!-- Custom stylesheets -->
{% for path in extra_css %}
<link rel="stylesheet" type="text/css" href="{{ path }}" />
{% endfor %}
{% endblock %}
<!-- Block: custom front matter -->
{%- block extrahead -%}{% endblock %}
</head>
<body>
@ -103,37 +123,41 @@
necessary for correctly rendering the table of contents which is
embedded into the navigation and the actual headline.
-->
{% set h1 = "\x3ch1 id=" in content %}
{% set h1 = "\x3ch1 id=" in page.content %}
<!-- Main navigation -->
{% if nav %}
<div class="md-sidebar md-sidebar--primary"
data-md-sidebar="primary">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/nav.html" %}
<!-- Block: navigation -->
{% block site_nav %}
<!-- Main navigation -->
{% if nav %}
<div class="md-sidebar md-sidebar--primary"
data-md-sidebar="primary">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/nav.html" %}
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
<!-- Table of contents -->
{% if toc %}
<div class="md-sidebar md-sidebar--secondary"
data-md-sidebar="secondary">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/toc.html" %}
<!-- Table of contents -->
{% if page.toc %}
<div class="md-sidebar md-sidebar--secondary"
data-md-sidebar="secondary">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/toc.html" %}
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
{% endblock %}
<!-- Article -->
<div class="md-content">
<article class="md-content__inner md-typeset">
<!-- Content block -->
<!-- Block: content -->
{% block content %}
<!-- Edit button, if URL was defined -->
@ -144,19 +168,17 @@
{% endif %}
<!-- Content -->
{{ content }}
{{ page.content }}
{% endblock %}
<!-- Copyright and theme information -->
<hr />
<small class="md-content__copyright">
{% if copyright %}
{{ copyright }} &ndash;
{% if config.copyright %}
{{ config.copyright }} &ndash;
{% endif %}
This document was created with
<a href="http://www.mkdocs.org">
MkDocs
</a>
<a href="http://www.mkdocs.org">MkDocs</a>
and the
<a href="http://squidfunk.github.io/mkdocs-material/">
Material
@ -169,41 +191,57 @@
</main>
<!-- Application footer -->
{% include "partials/footer.html" %}
{% block footer %}
{% include "partials/footer.html" %}
{% endblock %}
</div>
<!-- Extension-related JavaScript -->
{% for extension in config.markdown_extensions %}
<!-- Block: extension- and theme-related JavaScript -->
{% block scripts %}
{% for extension in config.markdown_extensions %}
<!-- MathJax integration -->
{% if extension == "pymdownx.arithmatex" %}
{% set path = "mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML" %}
<script src="https://cdn.mathjax.org/{{ path }}"></script>
<!-- MathJax integration -->
{% if extension == "pymdownx.arithmatex" %}
{% set path = "mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML" %}
<script src="https://cdn.mathjax.org/{{ path }}"></script>
{% endif %}
{% endfor %}
<!-- Theme-related and custom JavaScript -->
<script src="{{ base_url }}/assets/javascripts/application.js"></script>
<script>
/* Configuration for application */
var config = {
url: {
base: "{{ base_url }}",
}
};
/* Initialize application */
var app = new Application(config);
app.initialize();
</script>
{% for path in extra_javascript %}
<script src="{{ path }}"></script>
{% endfor %}
{% endblock %}
<!-- Block: analytic scripts -->
{% block analytics %}
{% if config.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');
ga('create',
'{{ config.google_analytics[0] }}',
'{{ config.google_analytics[1] }}');
ga('send', 'pageview');
</script>
{% endif %}
{% endfor %}
<!-- Theme-related and custom JavaScript -->
<script src="{{ base_url }}/assets/javascripts/application.js"></script>
<script>
/* Configuration for application */
var config = {
url: {
base: "{{ base_url }}",
},
repo: {
url: "{{ repo_url }}",
icon: "{{ repo_icon }}",
},
storage: window.sessionStorage,
};
/* Initialize application */
var app = new Application(config);
app.initialize();
</script>
{% for path in extra_javascript %}
<script src="{{ path }}"></script>
{% endfor %}
{% endblock %}
</body>
</html>

23
src/main.html Normal file
View File

@ -0,0 +1,23 @@
<!--
Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->
{% extends "base.html" %}

View File

@ -25,12 +25,12 @@
<div class="md-footer__inner">
<!-- Link to previous and/or next page -->
{% if previous_page or next_page %}
{% if page.previous_page or page.next_page %}
<nav class="md-footer-nav md-grid">
<!-- Link to previous page -->
{% if previous_page %}
<a href="{{ previous_page.url }}" title="{{ previous_page.title }}"
{% if page.previous_page %}
<a href="{{ page.previous_page.url }}" title="{{ page.previous_page.title }}"
class="md-flex md-footer-nav__link md-footer-nav__link--prev"
rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
@ -42,15 +42,15 @@
<span class="md-footer-nav__direction">
Previous
</span>
{{ previous_page.title }}
{{ page.previous_page.title }}
</span>
</div>
</a>
{% endif %}
<!-- Link to next page -->
{% if next_page %}
<a href="{{ next_page.url }}" title="{{ next_page.title }}"
{% if page.next_page %}
<a href="{{ page.next_page.url }}" title="{{ page.next_page.title }}"
class="md-flex md-footer-nav__link md-footer-nav__link--next"
rel="next">
<div class="md-flex__cell md-flex__cell--stretch
@ -59,7 +59,7 @@
<span class="md-footer-nav__direction">
Next
</span>
{{ next_page.title }}
{{ page.next_page.title }}
</span>
</div>
<div class="md-flex__cell md-flex__cell--shrink">

View File

@ -29,7 +29,7 @@
<!-- Link to home -->
<div class="md-flex__cell md-flex__cell--shrink">
<a href="{{ homepage_url }}" title="{{ site_name }}"
<a href="{{ nav.homepage.url }}" title="{{ config.site_name }}"
class="md-icon md-header-nav__icon md-header-nav__icon--home">
layers
</a>
@ -46,27 +46,33 @@
<!-- Header title -->
<div class="md-flex__cell md-flex__cell--stretch">
<span class="md-flex__ellipsis md-header-nav__title">
{{ page_title | default(site_name, true) }}
{%- block site_name -%}
{{ page.title | default(config.site_name, true) }}
{% endblock %}
</span>
</div>
<!-- Button to open search dialogue -->
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-header-nav__icon md-header-nav__icon--search"
for="search">
search
</label>
{%- block search_box -%}
<label class="md-icon md-header-nav__icon md-header-nav__icon--search"
for="search">
search
</label>
<!-- Search interface -->
{% include "partials/search.html" %}
<!-- Search interface -->
{% include "partials/search.html" %}
{% endblock %}
</div>
<!-- Repository containing source -->
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
{% if repo_url %}
{% include "partials/source.html" %}
{% endif %}
{%- block repo -%}
{% if config.repo_url %}
{% include "partials/source.html" %}
{% endif %}
{% endblock %}
</div>
</div>
</div>

View File

@ -54,8 +54,8 @@
</nav>
</li>
<!-- Current navigation item -->
{% elif nav_item == current_page %}
<!-- Main navigation item with nested items -->
{% elif nav_item == page %}
<li class="md-nav__item">
<!-- Active checkbox expands items contained within nested section -->

View File

@ -22,14 +22,14 @@
<!-- Main navigation -->
<nav class="md-nav md-nav--primary">
<label class="md-nav__title" for="drawer">{{ site_name }}</label>
<label class="md-nav__title" for="drawer">{{ config.site_name }}</label>
<ul class="md-nav__list">
{% for nav_item in nav %}
{% set path = "nav-" + loop.index | string %}
{% include "partials/nav-item.html" %}
{% endfor %}
</ul>
{% if repo_url %}
{% if config.repo_url %}
<div class="md-nav__source">
{% include "partials/source.html" %}
</div>

View File

@ -24,7 +24,7 @@
Check whether the repository is hosted on one of the supported code hosting
platforms (Github, Gitlab or Bitbucket) to show icon.
-->
{% set platform = config.extra.repo_icon or repo_url %}
{% set platform = config.extra.repo_icon or config.repo_url %}
{% if "github" in platform %}
{% set repo_type = "github" %}
{% set repo_icon = "md-source--github" %} <!-- TODO: remove this in favor of type -->
@ -40,7 +40,7 @@
{% endif %}
<!-- Repository containing source -->
<a href="{{ repo_url }}" title="Go to repository"
<a href="{{ config.repo_url }}" title="Go to repository"
class="md-source {{ repo_icon }}" data-md-source="{{ repo_type }}"> <!-- use <> for custom / private repo -->
<div class="md-source__repository">
{{ repo_name }}

View File

@ -22,6 +22,7 @@
<!-- Table of contents -->
<nav class="md-nav md-nav--secondary">
{% set toc = page.toc %}
<!--
The top-level anchor must be skipped if the article contains a h1 headline,