내 지킬 사이트에서 이전 블로그 게시물에 대한 아카이브를 만들고 싶습니다. 이전에 내 구조는 내 웹 사이트 인 index.html에서 _posts
의 내용을 제공했습니다. 온라인 콜렉션의 설명과 몇 가지 튜토리얼을 읽은 후, 나는 내 구조에 모음 폴더 _archive
을 추가하고 테스트 파일 안에 그러나지킬 컬렉션 렌더링하지 않음
test-file.markdown.
불리는 경우, url mysite.com/archive/test-file 완전히 내 주를 다시 생성 index.html, 컬렉션 내용이 아닙니다.
구조 :
_archive
index.html
test-file.markdown
_includes
about.html
head.html
... other stuff ...
_layouts
default.html
_posts
post1.markdown
post2.markdown
... other stuff ...
css
img
js
_config.yaml
... other stuff ...
시험 file.markdown
---
layout: default
title: test
---
_config.yml
# Site settings
title: test
email: [email protected]
url: http://www.test.com
# Color settings (hex-codes without the leading hash-tag)
color:
primary: ffffff #80B3FF
primary-rgb: "24,288,156" #"128,179,255"
secondary: 2c3e50 #FD6E8A
secondary-dark: 233140 #A2122F
third: 979797
collections:
archive:
output: true
permalink: /archive/:path/
# Build settings
markdown: kramdown
permalink: pretty
,745 1,515,
mysite.com/archive/index.html
---
---
{% for p in site.archive %}
{{ p}}
{{ p.title }}
{% endfor %}
이 재 렌더링 메인 index.html을, 시험 file.markdown 아닌 내용.
_archive
의 내용을 mysite.com/archive/에서 올바르게 렌더링하려면 어떻게해야합니까?
편집 : index.html 파일의 상단에
---
---
{% for p in site.archive %}
{{ p}}
{{ p.title }}
{% endfor %}
:
예, 감사합니다. 사이트는 여전히 내'_posts' 폴더 전체를 URL로 제공하고 있습니다 : site.com/archive/test/ –
그 밖의 다른 것들이 있습니까? 어떤 아이디어라도 @arniekoz에게 감사드립니다. –
아니요, 내용을 포장하지 마십시오. 그러나 @NickB 위의 편집은 작동하는지 확인하십시오. – arnolds