Update index.html

master
mayx 3 years ago
parent 69ea19f73d
commit 10d98e3eef

@ -23,6 +23,15 @@ title: 首页 - 我的文章
{% endfor %} {% endfor %}
</table> </table>
{% if paginator.total_pages > 1 %} {% 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"> <div class="pagination">
{% if paginator.previous_page %} {% if paginator.previous_page %}
{% if paginator.previous_page == 1 %} {% if paginator.previous_page == 1 %}
@ -34,15 +43,15 @@ title: 首页 - 我的文章
<span>&laquo; Prev</span> <span>&laquo; Prev</span>
{% endif %} {% endif %}
<select onchange="switchPage(this)">
{% for page in (1..paginator.total_pages) %} {% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %} {% if page == paginator.page %}
<em>{{ page }}</em> <option value="{{ page }}" selected>{{ page }}</option>
{% elsif page == 1 %}
<a href="{{ '/index.html' | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a>
{% else %} {% else %}
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}/">{{ page }}</a> <option value="{{ page }}">{{ page }}</option>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</select>
{% if paginator.next_page %} {% if paginator.next_page %}
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}/">Next &raquo;</a> <a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}/">Next &raquo;</a>

Loading…
Cancel
Save