Browse Source

List all posts

master
Chris 6 years ago
parent
commit
5986899c43
  1. 2
      config.toml
  2. 1
      layouts/eventtypes/term.html
  3. 2
      layouts/index.html
  4. 2
      layouts/partials/summary-with-image.html
  5. 34
      layouts/partials/summary.html

2
config.toml

@ -51,7 +51,7 @@ archetypeDir = "../kollegen-posts/archetypes"
# choose a background color from any on this page: http://tachyons.io/docs/themes/skins/ and preface it with "bg-"
background_color_class = "bg-dark-blue"
featured_image = "/images/070830-schatten.jpg"
recent_posts_number = 15
recent_posts_number = 999
[[menu.main]]
name = "Über"

1
layouts/eventtypes/term.html

@ -27,6 +27,7 @@
{{ range .Pages }}
<div class="relative w-100 mb4 bg-white">
{{ partial "summary.html" . }}
</div>
{{ end }}
</section>

2
layouts/index.html

@ -86,7 +86,7 @@
{{/* Use $section_name to get the section title. Use "with" to only show it if it exists */}}
{{ with .Site.GetPage "section" $section_name }}
<h1 class="flex-none">
{{ $.Param "recent_copy" | default (i18n "recentTitle" .) }}
Posts
</h1>
{{ end }}

2
layouts/partials/summary-with-image.html

@ -18,7 +18,7 @@
{{ if $image_link }}
<div class="pr3-ns mb4 mb0-ns w-100 w-40-ns">
<a href="{{.Permalink}}" class="db grow">
<img src="{{ $image_link }}" class="img" alt="image from {{ .Title }}">
<img src="{{ $image_link }}" class="img" loading="lazy" alt="image from {{ .Title }}">
</a>
</div>
{{ end }}

34
layouts/partials/summary.html

@ -1,4 +1,10 @@
<div class="mb3 pa4 mid-gray overflow-hidden">
{{ $image := partial "func/GetNamedImage.html" (dict "context" . "name" "featured_image") }}
{{ $image_link := ""}}
{{ with $image }}
{{ $image_link = $image.Permalink }}
{{ end }}
<div class=" pt2 pb2 pb3 pa3 mid-gray overflow-hidden">
{{ if .Date }}
<div class="f6">
<div class="flex justify-between">
@ -12,12 +18,24 @@
</div>
</div>
{{ end }}
<h1 class="f3 near-black">
<a href="{{ .Permalink }}" class="link black dim">
{{ .Title }}
</a>
</h1>
<div class="nested-links f5 lh-copy nested-copy-line-height">
{{ .Summary }}
<div class="flex">
{{ if $image_link }}
<div class="pr3-ns mb4 mb0-ns w-20">
<a href="{{.Permalink}}" class="db grow">
<img src="{{ $image_link }}" class="img" loading="lazy" alt="image from {{ .Title }}">
</a>
</div>
{{ end }}
<div class="flex flex-column w-80">
<h1 class="f3 near-black">
<a href="{{ .Permalink }}" class="link black dim">
{{ .Title }}
</a>
</h1>
<div class="nested-links f5 lh-copy nested-copy-line-height">
{{ .Summary }}
</div>
</div>
</div>
</div>

Loading…
Cancel
Save