Update index.html

master
mayx 3 years ago
parent 69ea19f73d
commit 10d98e3eef

@ -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>&laquo; 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 &raquo;</a>

Loading…
Cancel
Save