0
これは簡単な質問ですが、私はすでに多くの時間を費やしており、決定的な答えは見つかりません。ここに私のブログの現在の状態は次のとおりです。https://brucou.github.io/Projects
でHugo:セクションページにサブセクションのリストを表示する方法
、私は、次のディレクトリ構造を持っている:私のプロジェクトページ(/projects/
)で
Projects
Component combinators
Trees and forests
Circuitry
、私は、対応するサブの一覧を表示したいですフォルダ、すなわちComponent combinators
、Trees and forests
など、対応するパーマリンク。
私はつまり、例えば、プロジェクトページ、ディレクトリツリー、現在、このコードが表示さ/layouts/projects/list.html
<ul>
{{ template "section-tree-nav" .Site.Home }}
</ul>
{{ define "section-tree-nav" }}
{{ range .Sections}}
<li>{{ .Title }}
<ul>
{{ range .Pages }}
<li><a href="{{ .RelPermalink}}">{{ .Title }}</a></li>
{{ end }}
<ul>
{{ template "section-tree-nav" . }}
</ul>
</ul>
</li>
{{ end }}
{{ end }}
でこのコードを持っている:私の質問がある
Posts
Reactive programming : a component-based approach
A componentization model for cyclejs
Componentization against complexity
User interfaces as reactive systems
Projects
Component combinators
:
Projects
ディレクトリのコンテンツのみを表示する方法はありますか?または基本的にどのようにタイトルのコンテンツにif
を行うには?プロジェクトディレクトリの?私は、これはプロジェクトページに表示したいされ
:階層のレベルで
{{ partial "header" . }}
<article>
<header>
{{ partial "title" . }}
{{ with .Content }}{{.}}{{ end }}
</header>
{{ if (eq $.Parent.Title "Projects") }}
<ul class="no-bullet">
{{ range .Paginator.Pages }}
{{ partial "li" . }}
{{ end }}
</ul>
{{ partial "paginator" . }}
{{ else }}
{{ range (where .Site.Pages "Section" "projects") }}
<ul class="no-bullet">
{{ range .Sections }}
<li>
<span><time datetime="{{.Date}}">{{ .Date.Format .Site.Params.DateFmt }}</time></span>
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}
</article>
{{ partial "footer" . }}
{{/* keep the/right next to the parenthesis */}}
{{/* printf "%#v" $.CurrentSection.Title */}}
{{/* printf "%#v" (eq $.Parent.Title "Projects") */}}
基本的に、我々の枝:
Component combinators
Trees and forests