Print layout for the docs site

This commit is contained in:
Fedor Isakov 2018-08-23 14:59:37 +02:00
parent 6085481ede
commit dc213188c7
4 changed files with 42 additions and 2 deletions

View File

@ -57,6 +57,9 @@
background-color: #424242 !important;
}
@media print {
.content .printed-page { page-break-after: always; }
}
.content{
max-width: 800px;

View File

@ -1,8 +1,13 @@
- title: "Examples"
url: false
weight: 800
weight: 500
id: examples
- title: "All on Single Page"
url: "content/allpages.html"
weight: 890
tab: true
- title: "Links"
url: false
weight: 900

View File

@ -21,7 +21,7 @@
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.{{ mdl_colors }}.min.css" />
<link rel="stylesheet" href="{{ '/_assets/mdl.css' | absolute_url }}"/>
<link rel="stylesheet" href="{{ '/_assets/syntax.css' | absolute_url }}"/>
<title>{{ page.title }} | {{ site.title }}</title>
<title>{% if page.title %}{{ page.title }} | {% endif %}{{ site.title }}</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {

32
docs/_layouts/print.html Normal file
View File

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
{% include head.html %}
</head>
<body>
<div class="mdl-cell mdl-cell--bottom mdl-cell--1-col back">
</div>
<div class="mdl-cell mdl-cell--10-col">
<div class="page-content">
<div class="content">
<span class="mdl-layout-title">
<h1 id="title">
{% if page.title %}{{ page.title }} | {% endif %}{{ site.title }}
</h1>
</span>
{{ content }}
{% assign sorted_pages = site.pages | sort: 'weight' %}
{% for p in sorted_pages %}
{% if p.menu != false and p.weight != nil %}
<div class="printed-page">
{{ p.content | markdownify }}
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
<div class="mdl-cell mdl-cell--bottom mdl-cell--1-col forward">
</div>
</body>
</html>