krata/_includes/panel.html

79 lines
2.0 KiB
HTML
Raw Normal View History

2019-09-30 14:38:41 +02:00
<!--
The Pannel on right side (Desktop views)
2020-01-02 14:17:49 +01:00
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
2019-09-30 14:38:41 +02:00
© 2017-2019 Cotes Chung
MIT License
-->
2020-04-07 14:23:57 +02:00
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">
2019-09-30 14:38:41 +02:00
<div class="access">
2019-09-30 14:38:41 +02:00
2020-04-09 21:15:51 +02:00
{% if site.data.updates %}
{% assign MAX_SIZE = 5 %}
{% assign sum = 0 %}
{% assign sort_list = "" | split: "" %}
{% for entry in site.data.updates %}
{% capture elem %}
{{- entry.lastmod -}}::{{- entry.filename -}}
2019-10-24 20:40:42 +02:00
{% endcapture %}
2020-04-09 21:15:51 +02:00
{% assign sort_list = sort_list | push: elem %}
{% endfor %}
{% assign sort_list = sort_list | sort | reverse %}
{% if sort_list.size > 0 %}
2019-09-30 14:38:41 +02:00
2020-02-28 17:16:47 +01:00
<div id="access-lastmod" class="post">
2019-10-29 10:05:28 +01:00
<h3 data-toc-skip>
{{- site.data.label.panel.lastmod -}}
</h3>
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
2020-04-09 21:15:51 +02:00
{% for item in sort_list %}
{% assign post_url = item | split: "::" | last | prepend: "/posts/" | append: "/" %}
{% assign post = site.posts | where: "url", post_url | first %}
{% if post %}
{% assign url = post.url | prepend: site.baseurl %}
<li><a href="{{ url }}">{{ post.title }}</a></li>
{% assign sum = sum | plus: 1 %}
{% if sum >= MAX_SIZE %} {% break %} {% endif %}
{% endif %}
{% endfor %}
2019-10-29 10:05:28 +01:00
</ul>
</div><!-- #access-lastmod -->
2020-04-09 21:15:51 +02:00
{% endif %}
{% endif %} <!-- site.data.updates -->
2019-09-30 14:38:41 +02:00
2019-10-29 10:05:28 +01:00
<div id="access-tags">
<h3 data-toc-skip>
{{- site.data.label.panel.trending_tags -}}
</h3>
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
{% include trending-tags.html %}
</div>
</div>
2019-09-30 14:38:41 +02:00
2019-10-29 10:05:28 +01:00
</div> <!-- .access -->
{% if page.layout == 'post' and site.toc and page.toc %}
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
2020-02-28 17:16:47 +01:00
<h3 data-toc-skip class="pl-3 pt-2 mb-3">
{{- site.data.label.panel.toc -}}
</h3>
<nav id="toc" data-toggle="toc"></nav>
</div>
2019-10-29 10:05:28 +01:00
{% endif %}
</div> <!-- #panel-wrapper -->