update theme
This commit is contained in:
parent
ea0939fdd1
commit
95fd7d229c
6 changed files with 79 additions and 30 deletions
|
@ -39,6 +39,7 @@
|
||||||
<noscript><link rel="stylesheet" href="{{ url }}"></noscript>
|
<noscript><link rel="stylesheet" href="{{ url }}"></noscript>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<link rel="stylesheet" href="/materialize/css/materialize.css">
|
||||||
|
|
||||||
{% block add_head %}{% endblock %}
|
{% block add_head %}{% endblock %}
|
||||||
|
|
||||||
|
|
11
themes/cmd/layout/includes/paginator.swig
Normal file
11
themes/cmd/layout/includes/paginator.swig
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
{% macro Paginiation() %}
|
||||||
|
<ul class="pagination center">
|
||||||
|
<li class="{% if page.current == 1 %}disabled{% else %}waves-effect{% endif %}"><a href="{% if (page.current-1) == 1 %}{{url_for('/')}}{% else %}{{ page.prev_link }}{% endif %}"><i class="mdi mdi-chevron-left"></i></a></li>
|
||||||
|
<li class="{% if page.current == 1 %}active{% else %}waves-effect{% endif %}"><a href="{{ url_for('/') }}">1</a></li>
|
||||||
|
{% for n in range(2, page.total, 1) %}
|
||||||
|
<li class="{% if page.current == n %}active{% else %}waves-effect{% endif %}"><a href="{{ url_for('page/'+n+'/') }}">{{n}}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
<li class="{% if page.current == page.total %}disabled{% else %}waves-effect{% endif %}"><a href="{{ page.next_link }}"><i class="mdi mdi-chevron-right"></i></a></li>
|
||||||
|
</ul>
|
||||||
|
{% endmacro %}
|
|
@ -77,16 +77,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro Paginiation() %}
|
{% import "includes/paginator.swig" as P%}
|
||||||
<ul class="pagination">
|
|
||||||
<li class="{% if page.current == 1 %}disabled{% else %}waves-effect{% endif %}"><a href="{% if (page.current-1) == 1 %}{{url_for('/')}}{% else %}{{ page.prev_link }}{% endif %}"><i class="mdi mdi-chevron-left"></i></a></li>
|
|
||||||
<li class="{% if page.current == 1 %}active{% else %}waves-effect{% endif %}"><a href="{{ url_for('/') }}">1</a></li>
|
|
||||||
{% for n in range(2, page.total, 1) %}
|
|
||||||
<li class="{% if page.current == n %}active{% else %}waves-effect{% endif %}"><a href="{{ url_for('page/'+n+'/') }}">{{n}}</a></li>
|
|
||||||
{% endfor %}
|
|
||||||
<li class="{% if page.current == page.total %}disabled{% else %}waves-effect{% endif %}"><a href="{{ page.next_link }}"><i class="mdi mdi-chevron-right"></i></a></li>
|
|
||||||
</ul>
|
|
||||||
{% endmacro %}
|
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -100,7 +91,7 @@
|
||||||
<span>No Post Here...</span>
|
<span>No Post Here...</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="center">
|
<div class="center">
|
||||||
{{ Paginiation() }}
|
{{ P.Paginiation() }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col m4 l3 hide-on-small-only">
|
<div class="col m4 l3 hide-on-small-only">
|
||||||
|
|
|
@ -1,9 +1,45 @@
|
||||||
{% extends 'includes/layout.swig' %}
|
{% extends 'includes/layout.swig' %}
|
||||||
|
|
||||||
|
{% macro PostTags(post) %}
|
||||||
|
<div>
|
||||||
|
{% for k in Object.keys(post.tags.data) %}
|
||||||
|
<a href="{{ url_for(post.tags.data[k].path)}}"><div class="chip">
|
||||||
|
{{post.tags.data[k].name}}
|
||||||
|
</div></a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro Gallery(photos) %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
{% set i = 0 %}
|
||||||
|
{% for p in photos %}
|
||||||
|
{% set i = i + 1 %}
|
||||||
|
<img onerror="M.toast({ html: 'Some photos could not be showed at the moment, please try again later.' });" src="{{p}}" data-caption="{{i}}" class="responsive-img materialboxed gallery-img" async />
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<article id="page">
|
<article id="post">
|
||||||
<h1>{{ page.title }}</h1>
|
<div class="card">
|
||||||
|
<div class="card-content">
|
||||||
|
<span class="card-title">{{ page.title }}</span>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col" style="padding-left:0;"><span class="mdi mdi-account">{{config.author}}</span></div>
|
||||||
|
<div class="col"><span class="mdi mdi-clock">{{date(page.date, 'YYYY/M/D')}}</span></div>
|
||||||
|
</div>
|
||||||
|
{{ PostTags(page) }}
|
||||||
|
{% if page.photos && page.photos.length > 0%}
|
||||||
|
{{Gallery(page.photos)}}
|
||||||
|
{% endif %}
|
||||||
|
<div class="entry">
|
||||||
{% autoescape false %}{{ page.content }}{% endautoescape %}
|
{% autoescape false %}{{ page.content }}{% endautoescape %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<div id="paginator">
|
<div id="paginator">
|
||||||
|
|
|
@ -1,21 +1,27 @@
|
||||||
{% extends 'includes/layout.swig' %}
|
{% extends 'includes/layout.swig' %}
|
||||||
|
|
||||||
{% block body %}
|
{% import "includes/paginator.swig" as P %}
|
||||||
<div id="tag">
|
|
||||||
<h1>{{ page.tag }}</h1>
|
|
||||||
{% for article in page.posts.toArray() %}
|
|
||||||
<div class="tag-item">
|
|
||||||
<a href="{{ url_for(article.path) }}">
|
|
||||||
{{ article.title }}
|
|
||||||
</a>
|
|
||||||
<time datetime="{{ date_xml(article.date) }}">
|
|
||||||
{{ date(article.date) }}
|
|
||||||
</time>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="paginator">
|
{% block body %}
|
||||||
{{ paginator() }}
|
<h2 style="margin-left: 1rem">{{page.tag}}</h2>
|
||||||
|
<ul class="collapsible popout">
|
||||||
|
{% for article in page.posts.toArray() %}
|
||||||
|
<li>
|
||||||
|
<div class="collapsible-header">{{article.title}}</div>
|
||||||
|
<div class="collapsible-body small-padding">
|
||||||
|
<div class="mdi mdi-clock" style="padding-left: 1rem; padding-bottom: 8px;">{{ date(article.date) }}</div>
|
||||||
|
<div class="entry">{{article.excerpt}}</div>
|
||||||
|
<div class="card z-depth-0">
|
||||||
|
<div class="card-action" style="padding-bottom: 0; padding-left: 14px;">
|
||||||
|
<a href="{{url_for(article.path)}}">Go To "{{article.title}}"</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div id="center">
|
||||||
|
{{ P.Paginiation() }}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -20,3 +20,7 @@ main
|
||||||
@media only screen and (min-width: 992px)
|
@media only screen and (min-width: 992px)
|
||||||
.card .card-content
|
.card .card-content
|
||||||
padding: 12px
|
padding: 12px
|
||||||
|
|
||||||
|
.collapsible .small-padding
|
||||||
|
padding: 1rem !important
|
||||||
|
padding-bottom: 0 !important
|
Loading…
Reference in a new issue