From 420b841ecf6d79ec4ebc725b9a2ea82bb4217085 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Thu, 15 Dec 2016 18:29:46 +0100 Subject: [PATCH] Bring back h1 headline handling from 0.2.4 --- material/assets/javascripts/application.js | 8 ++--- material/assets/javascripts/modernizr.js | 34 ++++++++++----------- material/assets/stylesheets/application.css | 14 +++++++++ material/base.html | 4 ++- material/partials/toc.html | 2 +- src/base.html | 17 ++++++----- src/partials/toc.html | 10 +++--- 7 files changed, 53 insertions(+), 36 deletions(-) diff --git a/material/assets/javascripts/application.js b/material/assets/javascripts/application.js index b5caa9d59..5680dbdad 100644 --- a/material/assets/javascripts/application.js +++ b/material/assets/javascripts/application.js @@ -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 @@ -5400,4 +5400,4 @@ var Application = /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15))) /***/ } -/******/ ]); +/******/ ]); \ No newline at end of file diff --git a/material/assets/javascripts/modernizr.js b/material/assets/javascripts/modernizr.js index 6dbb469cb..6ed45dcf7 100644 --- a/material/assets/javascripts/modernizr.js +++ b/material/assets/javascripts/modernizr.js @@ -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 `` or `` elements. */ var testStyles = ModernizrProto.testStyles = injectElementWithStyles; - + /*! { "name": "@font-face", @@ -814,11 +814,11 @@ Detects support for SVG in `` or `` 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 `` or `` elements. delete modElem.elem; }); - + var mStyle = { style: modElem.elem.style @@ -864,7 +864,7 @@ Detects support for SVG in `` or `` elements. delete mStyle.style; }); - + /** * domToCSS takes a camelCase string and converts it to kebab-case @@ -1054,7 +1054,7 @@ Detects support for SVG in `` or `` 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 `` or `` 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 `` or `` elements. return testPropsAll(prop, undefined, undefined, value, skipValueTest); } ModernizrProto.testAllProps = testAllProps; - + /*! { "name": "CSS Supports", @@ -1283,4 +1283,4 @@ Detects support for SVG in `` or `` elements. ; -})(window, document); +})(window, document); \ No newline at end of file diff --git a/material/assets/stylesheets/application.css b/material/assets/stylesheets/application.css index 7b8ceabc1..cc44db127 100644 --- a/material/assets/stylesheets/application.css +++ b/material/assets/stylesheets/application.css @@ -200,6 +200,13 @@ kbd { margin: 0; background: transparent; box-shadow: none; } + .md-typeset a > code { + margin: inherit; + padding: inherit; + border-radius: none; + background: inherit; + color: inherit; + box-shadow: none; } .md-typeset pre { margin: 1.0em 0; padding: 1.0rem 1.2rem; @@ -280,6 +287,7 @@ kbd { .md-typeset ol li ol { margin: 0.5em 0 0.5em 0.625em; } .md-typeset table { + width: 90%; margin: 1.5em 0; font-size: 1.28rem; overflow: hidden; } @@ -300,6 +308,12 @@ kbd { padding: 1.2rem 1.6rem; border-top: 0.1rem solid rgba(0, 0, 0, 0.07); vertical-align: top; } + .md-typeset table th[align="right"], + .md-typeset table td[align="right"] { + text-align: right; } + .md-typeset table th[align="center"], + .md-typeset table td[align="center"] { + text-align: center; } .md-typeset table tr:first-child td { border-top: 0; } diff --git a/material/base.html b/material/base.html index 1fca06577..bcdb9c4e3 100644 --- a/material/base.html +++ b/material/base.html @@ -51,7 +51,6 @@
- {% set h1 = "\x3ch1 id=" in page.content %} {% block site_nav %} {% if nav %}
@@ -80,6 +79,9 @@ Edit {% endif %} + {% if not "\x3ch1 id=" in page.content %} +

{{ page.title | default(config.site_name, true)}}

+ {% endif %} {{ page.content }} {% endblock %}
diff --git a/material/partials/toc.html b/material/partials/toc.html index a8fd27a76..db1fadecd 100644 --- a/material/partials/toc.html +++ b/material/partials/toc.html @@ -1,6 +1,6 @@