mirror of https://github.com/docker/docs.git
Merge pull request #15994 from crazy-max/page-date
display reading time and tags in toc nav
This commit is contained in:
commit
2cb71f2573
|
@ -1,6 +0,0 @@
|
||||||
{%- unless page.skip_read_time == true -%}
|
|
||||||
{%- assign words = content | number_of_words -%}
|
|
||||||
{%- if words >= 360 -%}
|
|
||||||
<em class="reading-time">Estimated reading time: {{ words | divided_by:180 }} minutes</em>
|
|
||||||
{%- endif -%}
|
|
||||||
{%- endunless -%}
|
|
|
@ -28,20 +28,8 @@
|
||||||
{%- if page.advisory -%}
|
{%- if page.advisory -%}
|
||||||
<blockquote>{{ site.data.advisories.texts[page.advisory] | markdownify }}</blockquote>
|
<blockquote>{{ site.data.advisories.texts[page.advisory] | markdownify }}</blockquote>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
<p>{%- include read_time.html -%}</p>
|
<p></p>
|
||||||
{{ content }}
|
{{ content }}
|
||||||
{%- unless page.notags == true -%}
|
|
||||||
{%- assign keywords = page.keywords | split:"," -%}
|
|
||||||
{%- if keywords.size > 0 -%}
|
|
||||||
<span class="glyphicon glyphicon-tags" style="padding-right: 10px"></span><span style="vertical-align: 2px">
|
|
||||||
{%- for keyword in keywords -%}
|
|
||||||
{%- assign strippedKeyword = keyword | strip -%}
|
|
||||||
<a href="/search/?q={{ strippedKeyword }}">{{ strippedKeyword }}</a>
|
|
||||||
{%- unless forloop.last %}, {% endunless -%}
|
|
||||||
{%- endfor -%}
|
|
||||||
</span>
|
|
||||||
{%- endif -%}
|
|
||||||
{%- endunless %}
|
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
<nav class="col-nav">
|
<nav class="col-nav">
|
||||||
|
@ -64,11 +52,12 @@
|
||||||
{%- assign my_min = page.toc_min | default: site.toc_min | default: 2 -%}
|
{%- assign my_min = page.toc_min | default: site.toc_min | default: 2 -%}
|
||||||
{%- assign my_max = page.toc_max | default: site.toc_max | default: 3 -%}
|
{%- assign my_max = page.toc_max | default: site.toc_max | default: 3 -%}
|
||||||
{%- assign my_name = page.url | default: "unnamed" -%}
|
{%- assign my_name = page.url | default: "unnamed" -%}
|
||||||
<div id="side-toc-title">Contents:</div>
|
<div class="side-toc-title">Page details</div>
|
||||||
{%- include toc_pure_liquid.html html=content sanitize=true class="inline_toc" id="my_toc" toc_min=my_min toc_max=my_max page_name=my_name -%}
|
<div class="metadata-items">
|
||||||
{%- endunless -%}
|
|
||||||
<div class="feedback-links">
|
|
||||||
<ul>
|
<ul>
|
||||||
|
{%- unless page.skip_read_time == true %}{% assign words = content | number_of_words %}{% if words >= 360 -%}
|
||||||
|
<li title="Estimated reading time"><i class="fa fa-clock" aria-hidden="true"></i> {{ words | divided_by:180 }} minutes read</span></li>
|
||||||
|
{%- endif %}{% endunless -%}
|
||||||
{%- if edit_url != "" -%}
|
{%- if edit_url != "" -%}
|
||||||
<li><a href="{{ edit_url }}"><i class="fa fa-pencil" aria-hidden="true"></i> Edit this page</a></li>
|
<li><a href="{{ edit_url }}"><i class="fa fa-pencil" aria-hidden="true"></i> Edit this page</a></li>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
@ -77,6 +66,22 @@
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
{%- unless page.notags == true -%}
|
||||||
|
{%- assign keywords = page.keywords | split:"," -%}
|
||||||
|
{%- if keywords.size > 0 -%}
|
||||||
|
<div class="side-toc-title">Tags</div>
|
||||||
|
<div class="keywords-items">
|
||||||
|
{%- for keyword in keywords -%}
|
||||||
|
{%- assign strippedKeyword = keyword | strip -%}
|
||||||
|
<a href="/search/?q={{ strippedKeyword }}" class="nomunge"><i class="fa fa-tag" aria-hidden="true"></i> {{ strippedKeyword }}</a>
|
||||||
|
{%- endfor -%}
|
||||||
|
</div>
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endunless %}
|
||||||
|
<div class="side-toc-title">Contents</div>
|
||||||
|
{%- include toc_pure_liquid.html html=content sanitize=true class="inline_toc" id="my_toc" toc_min=my_min toc_max=my_max page_name=my_name -%}
|
||||||
|
{%- endunless -%}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -163,7 +163,7 @@
|
||||||
color: #677285;
|
color: #677285;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#side-toc-title {
|
div.side-toc-title {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 11px 0 10px 13px;
|
margin: 11px 0 10px 13px;
|
||||||
|
@ -281,14 +281,40 @@ input:checked+.slider:before {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
div.feedback-links {
|
||||||
* feedback links **************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
.feedback-links {
|
|
||||||
margin: 15px 0 10px 0;
|
margin: 15px 0 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.metadata-items {
|
||||||
|
margin: 15px 0 10px 0;
|
||||||
|
ul {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
li {
|
||||||
|
padding: 2px 8px 2px 0;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 12px;
|
||||||
|
a {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
div.keywords-items {
|
||||||
|
padding-left: 20px;
|
||||||
|
font-size: 12px;
|
||||||
|
a {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 8px;
|
||||||
|
i.fa {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Controls ********************************************************************
|
* Controls ********************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue