Files
HugoBlox-kit/layouts/project/single.html
T
George Cushen 8010d5a45c refactor(project): projects not listing child pages
Simplify code to get content name by using `.File.ContentBaseName` -
it gets content name irrespective of whether page is a bundle or not.

See #800

BREAKING CHANGE

`url_project` can now only be used to link pages to external websites.
To link a page to a project page, use `projects` option.
2018-11-29 21:01:37 +00:00

83 lines
2.8 KiB
HTML

{{ partial "header.html" . }}
{{ partial "navbar.html" . }}
<article class="article article-project" itemscope itemtype="http://schema.org/Article">
{{ partial "page_header.html" . }}
<div class="article-container">
<div class="article-style" itemprop="articleBody">
{{ .Content }}
</div>
{{ partial "tags.html" . }}
{{ partial "page_author.html" . }}
{{ $page := . }}
{{ $project := .File.ContentBaseName }}
{{ if (.Site.Params.projects.list_children | default true) }}
{{ $items := where (where .Site.RegularPages "Type" "post") ".Params.projects" "intersect" (slice $project) }}
{{ $count := len $items }}
{{ if ge $count 1 }}
<h2>{{ (i18n "posts") }}</h2>
{{ range $items }}
{{ if eq $page.Site.Params.projects.post_format 0 }}
{{ partial "post_li_simple" . }}
{{ else if eq $page.Site.Params.projects.post_format 1 }}
{{ partial "post_li_detailed" . }}
{{ else }}
{{ partial "post_li_stream" . }}
{{ end }}
{{ end }}
{{ end }}
{{ $items := where (where .Site.RegularPages "Type" "publication") ".Params.projects" "intersect" (slice $project) }}
{{ $pubs_len := len $items }}
{{ if ge $pubs_len 1 }}
<h2>{{ (i18n "publications") }}</h2>
{{ range $items }}
{{ if eq $page.Site.Params.projects.publication_format 1 }}
{{ partial "publication_li_detailed" . }}
{{ else if eq $page.Site.Params.projects.publication_format 2 }}
{{ partial "publication_li_apa" . }}
{{ else if eq $page.Site.Params.projects.publication_format 3 }}
{{ partial "publication_li_mla" . }}
{{ else if eq $page.Site.Params.projects.publication_format 4 }}
{{ partial "publication_li_stream" . }}
{{ else }}
{{ partial "publication_li_simple" . }}
{{ end }}
{{ end }}
{{ end }}
{{ $items := where (where .Site.RegularPages "Type" "talk") ".Params.projects" "intersect" (slice $project) }}
{{ $talks_len := len $items }}
{{ if ge $talks_len 1 }}
<h2>{{ (i18n "talks") }}</h2>
{{ range sort $items ".Params.time_start" "desc" }}
{{ if eq $page.Site.Params.projects.talk_format 1 }}
{{ partial "talk_li_detailed" . }}
{{ else if eq $page.Site.Params.projects.talk_format 2 }}
{{ partial "talk_li_stream" . }}
{{ else }}
{{ partial "talk_li_simple" . }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>
</article>
{{ if .Site.Params.section_pager }}
<div class="article-container article-widget">
{{ partial "section_pager.html" . }}
</div>
{{ end }}
{{ partial "footer_container.html" . }}
{{ partial "footer.html" . }}