【问题标题】:Docpad paging 404 errorDocpad 分页 404 错误
【发布时间】:2013-05-28 06:10:23
【问题描述】:

告诉我,为什么停止工作分页。 相反,分页有效,但提供 404 页面。

示例:altyncev.ru/posts

Configposts file 在我的仓库中。

未进行全局更改。

帖子:

<% posts = @getCollection('posts') %>
<% for i in [@document.page.startIdx...@document.page.endIdx]: %>
    <% document = posts.at(i).toJSON() %>
    <article class="post">
        <p class="posts_date"><%= @formatDate(document.date) %></p>
        <a href="<%= document.url %>"><h3><%= document.title %></h3></a>
        <div class="post-content"><%- @getCuttedContent(String(document.contentRenderedWithoutLayouts)) %></div>
        <% if @hasReadMore(String(document.contentRenderedWithoutLayouts)): %>
        <div class="read_more"><a href="<%= document.url %>"><strong>Читать далее &rarr;</strong></a></div>
        <% end %>
    </article>
<% end %>

<div class="pagination">
    <ul>
        <% if !@getDocument().hasPrevPage(): %>
            <li class="disabled"><span>«</span></li>
        <% else: %>
            <li><a href="<%= @getDocument().getPrevPage() %>">«</a></li>
        <% end %>
        <% for num in [0..@document.page.count-1]: %>
            <% if @document.page.number == num: %>
                <li class="active"><span><%= num %></span></li>
            <% else: %>
                <li><a href="<%= @getDocument().getPagedUrl(num) %>"><%= num %></a></li>
            <% end %>
        <% end %>
        <% if !@getDocument().hasNextPage(): %>
            <li class="disabled"><span>»</span></li>
        <% else: %>
            <li><a href="<%= @getDocument().getNextPage() %>">»</a></li>
        <% end %>
    </ul>
</div>

【问题讨论】:

    标签: http-status-code-404 paging docpad


    【解决方案1】:

    这个 DocPad 插件可能是一种偷偷摸摸的方式: https://github.com/docpad/docpad-plugin-paged

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-18
      • 2013-04-16
      • 2013-05-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多