2014-06-23 3 views
5

내 Github 계정으로 Octopress를 http://acgrama.github.io/에 설정했습니다. 메인 페이지는 바닐라 HTML, Octopress가 아닌 방문 페이지이며, 블로그는 소스/블로그 아래 Octopress에 설정되어 있습니다. 내가 블로그 아카이브 대신 최신 블로그 게시물에 대한 링크를 참조 http://acgrama.github.io/blog/에 갈 때를 제외하고Github 페이지의 리디렉션 Octopress 블로그는 최신 게시물 대신 아카이브 링크 만 표시합니다.

모든 것이 괜찮습니다 (나는 http://octopress.org/docs/theme/template/의 섹션 "블로그 색인 대 방문 페이지"의 지시 사항을 준수). 내가 생성 레이크 않을 때, 나는 다음과 같은 출력을 얻을 : 내가 발견

일부 증상은

## Generating Site with Jekyll 
identical source/stylesheets/screen.css 
Configuration file: /home/***/octopress/_config.yml 
      Source: source 
     Destination: public 
     Generating... 
     Pagination: Pagination is enabled, but I couldn't find an index.html page to use as the pagination template. Skipping pagination. 
        done. 

소스/블로그/index.html을 아래 상대를, 나는 paginator.posts의 게시물이 반복 된 것으로 알고 있습니다 그림과, 이전/최신 및 블로그 아카이브 링크가 표시되는 후 (?) :

<div class="blog-index"> 
    {% assign index = true %} 
    {% for post in paginator.posts %} 
    {% assign content = post.content %} 
    <article> 
     {% include article.html %} 
    </article> 
    {% endfor %} 
    <div class="pagination"> 
    {% if paginator.next_page %} 
     <a class="prev" href="{{paginator.next_page_path}}">&larr; Older</a> 
    {% endif %} 
    <a href="/blog/archives">Blog Archives</a> 
    {% if paginator.previous_page %} 
    <a class="next" href="{{paginator.previous_page_path}}">Newer &rarr;</a> 
    {% endif %} 
    </div> 
</div> 

이 날 paginator.posts 어떤 이유로 빈이라고 생각했고, 따라서 아무것도 루프이를 위해 먼저 발생하지 않습니다 블로그 아카이브 링크 만 표시되는 방식입니다.

뭐가 잘못 되었나요? 이 문제를 전혀 해결할 수 있습니까?

답변

15

paginator.posts가 비어 있다는 의심에 근거하여 정확히 동일한 문제와 I found an answer이 있습니다.

업데이트 _config.yml는 다음과 같은 설정 :

paginate_path: "posts/:num" 

그 후

paginate_path: "blog/posts/:num" 

에와 레이크 생성하고 미리보기를 긁어의/블로그 페이지 내 게시물

이 나타났다 paginator가/blog에 대한 하위 디렉토리 변경을 인식해야한다고 생각하게 만듭니다. 실제로해야 할 일처럼 보입니다. docs

+0

감사합니다. 꽤 많이 들립니다. 나는 그것을 시도 할 것이다. – Cristina

+0

그것은 실제로 작동합니다 - 뒤늦은 견해로, 나는 이것을 놓친 방법을 모르겠습니다 :-) 다시 한번 감사드립니다. – Cristina

+0

방문 페이지를 설정 한 후에도 마찬가지로 나를 위해 일했습니다. –