nemhugo/layouts/index.html
Zev Goldstein c28a214abb
Allow custom summaries
This is an "escape hatch" that can be used when neither automatic nor manual summary splitting is sufficient to create a good summary.  This is specifically useful for articles that begin with a disclaimer or anything else that shouldn't be included in the summary.  It's also useful for footnote links and other mid-text items that should be excluded from the summary.
2018-06-13 19:30:16 -04:00

65 lines
2.2 KiB
HTML

{{ define "main" }}
<div role="main" class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
{{ with .Content }}
<div class="well">
{{.}}
</div>
{{ end }}
<div class="posts-list">
{{ $pag := .Paginate (where .Data.Pages "Type" "post") }}
{{ range $pag.Pages }}
<article class="post-preview">
<a href="{{ .Permalink }}">
<h2 class="post-title">{{ .Title }}</h2>
{{ if .Params.subtitle }}
<h3 class="post-subtitle">
{{ .Params.subtitle }}
</h3>
{{ end }}
{{ if .Params.image }}
<img src="{{ .Params.image }}" class="img-title" />
{{ end }}
</a>
{{ partial "post_meta.html" . }}
<div class="post-entry">
{{ if .Truncated }}
{{ if .Params.summary }}{{ .Params.summary }}{{ else }}{{ .Summary }}{{ end }}
<a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a>
{{ else }}
{{ .Content }}
{{ end }}
</div>
{{ if .Params.tags }}
<div class="blog-tags">
{{ range .Params.tags }}
<a href="{{ $.Site.LanguagePrefix | absURL }}/tags/{{ . | urlize }}/">{{ . }}</a>&nbsp;
{{ end }}
</div>
{{ end }}
</article>
{{ end }}
</div>
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
<ul class="pager main-pager">
{{ if .Paginator.HasPrev }}
<li class="previous">
<a href="{{ .Paginator.Prev.URL | absURL }}">&larr; {{ i18n "newerPosts" }}</a>
</li>
{{ end }}
{{ if .Paginator.HasNext }}
<li class="next">
<a href="{{ .Paginator.Next.URL | absURL }}">{{ i18n "olderPosts" }} &rarr;</a>
</li>
{{ end }}
</ul>
{{ end }}
</div>
</div>
</div>
{{ end }}