2016-06-16 5 views
0

휴고 v0.16을 사용하고 테마를 만들 때 문제가 있습니다. 블록을 정의하고 휴고 테마에서 오버라이드를 정의하십시오.

는 기본적으로 나는 좋은 엔트리 포인트가 /themes/THEME/layouts/_default/taxonomy.html 파일에 있어야합니다 것으로 보인다 문서 here를 읽은 후 내 분류

나중에 그것을 무시하기 위해 {{ block }} 항목과 list.html 파일을 정의합니다. 그러나 렌더링 할 때 내 index.html 분류 파일에서 정의를 사용합니다. 나는 이것이 버그라고 생각하지만, 나는 단지 확신하고 싶다. 여기

내 파일의 기본 내용은 다음과 같습니다

_default/list.html

<h1>Foo {{ block "bar"}}{{ end }}</h1> 

_default/taxonomy.html

{{ define "bar" }}Bar{{ end }} 

내가 기다리고 있었다 :

index.html

<h1>Foo </h1> 

/taxonomy_plural/taxonomy_term/

<h1>Foo Bar</h1> 

그러나 index.html을 보이는 등/taxonomy_plural/taxonomy_term/누군가가 나에게 준으로 내가

답변

0

내가 내 자신의 질문에 대답 할 원하는하지 않은 솔루션

여기에 설명 된대로 https://discuss.gohugo.io/t/blocks-and-define-override-in-hugo-theme/3543, 내가 baseof * .html을 사용하면 가능합니다. 그래서 여기

최종 구조 :

_default/baseof.html

<h1>Foo {{ block "bar"}}{{ end }}</h1> 

index.html가 비어 있고 _default/taxonomy.html

{{ define "bar" }}Bar{{ end }} 

를 포함하고 내가 필요한 것을 제공