mirror of https://gitlab.com/mayx/mayx.gitlab.io
Update index.html
parent
69ea19f73d
commit
10d98e3eef
17
index.html
17
index.html
|
@ -23,6 +23,15 @@ title: 首页 - 我的文章
|
|||
{% endfor %}
|
||||
</table>
|
||||
{% if paginator.total_pages > 1 %}
|
||||
<script>
|
||||
function switchPage(sobj){
|
||||
if (sobj.value == 1){
|
||||
window.location = "{{ '/index.html' | prepend: site.baseurl | replace: '//', '/' }}";
|
||||
} else {
|
||||
window.location = "{{ '/page' | prepend: site.baseurl | replace: '//', '/' }}" + sobj.value + "/";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="pagination">
|
||||
{% if paginator.previous_page %}
|
||||
{% if paginator.previous_page == 1 %}
|
||||
|
@ -34,15 +43,15 @@ title: 首页 - 我的文章
|
|||
<span>« Prev</span>
|
||||
{% endif %}
|
||||
|
||||
<select onchange="switchPage(this)">
|
||||
{% for page in (1..paginator.total_pages) %}
|
||||
{% if page == paginator.page %}
|
||||
<em>{{ page }}</em>
|
||||
{% elsif page == 1 %}
|
||||
<a href="{{ '/index.html' | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a>
|
||||
<option value="{{ page }}" selected>{{ page }}</option>
|
||||
{% else %}
|
||||
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}/">{{ page }}</a>
|
||||
<option value="{{ page }}">{{ page }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
{% if paginator.next_page %}
|
||||
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}/">Next »</a>
|
||||
|
|
Loading…
Reference in New Issue