Merge pull request #7 from budparr/dev

Improve home page posts
This commit is contained in:
Bud Parr 2017-04-17 18:36:56 -04:00 committed by GitHub
commit 4bf13cdb8c
3 changed files with 26 additions and 4 deletions

View file

@ -2,6 +2,7 @@ title = "Notre-Dame de Paris"
baseURL = "https://example.com" baseURL = "https://example.com"
languageCode = "en-us" languageCode = "en-us"
theme = "gohugo-theme-ananke" theme = "gohugo-theme-ananke"
themesDir = "../.."
MetaDataFormat = "yaml" MetaDataFormat = "yaml"
DefaultContentLanguage = "en" DefaultContentLanguage = "en"

View file

@ -2,8 +2,10 @@
<main class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy mid-gray"> <main class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy mid-gray">
{{ .Content }} {{ .Content }}
</main> </main>
{{/* Create a variable to use the same section twice. Note that we've included the date here. */}} {{/* For Hugo 0.20 this will default to the section with the most number of pages. */}}
{{ $section := where .Data.Pages.ByDate.Reverse "Section" "post" }} {{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
{{/* Create a variable to use the same section twice. */}}
{{ $section := where .Site.RegularPages "Section" "in" $mainSections }}
{{ if $section }} {{ if $section }}
<div class="pa3 pa4-ns w-100 w-70-ns center"> <div class="pa3 pa4-ns w-100 w-70-ns center">
@ -14,7 +16,7 @@
<section class="w-100 mw8"> <section class="w-100 mw8">
{{ range (first 3 $section) }} {{ range (first 3 $section) }}
<div class="relative w-100 mb4"> <div class="relative w-100 mb4">
{{ .Render "summary-with-image" }} {{ partial "summary-with-image.html" . }}
</div> </div>
{{ end }} {{ end }}
</section> </section>
@ -22,7 +24,7 @@
<section class="w-100"> <section class="w-100">
<h1 class="f3">More Posts</h1> <h1 class="f3">More Posts</h1>
{{/* Nest the requirements, "after" then "first" on the outside */}} {{/* Nest the requirements, "after" then "first" on the outside */}}
{{ range (first 4 (after 1 $section)) }} {{ range (first 4 (after 3 $section)) }}
<h2 class="f5 fw4 mb4 dib mr3"> <h2 class="f5 fw4 mb4 dib mr3">
<a href="{{ .URL }}" class="link black dim"> <a href="{{ .URL }}" class="link black dim">
{{ .Title }} {{ .Title }}

View file

@ -0,0 +1,19 @@
<article class="bb b--black-10">
<a class="db pv4 ph3 ph0-l no-underline dark-gray dim" href="{{ .URL }}">
<div class="flex flex-column flex-row-ns">
{{ if .Params.featured_image }}
<div class="pr3-ns mb4 mb0-ns w-100 w-40-ns">
<img src="{{ .Params.featured_image }}" class="db" alt="image from {{ .Title }}">
</div>
{{ end }}
<div class="w-100{{ if .Params.featured_image }} w-60-ns pl3-ns{{ end }}">
<h1 class="f3 fw1 athelas mt0 lh-title">{{ .Title }}</h1>
<p class="f6 f5-l lh-copy">
{{ .Summary }}
</p>
{{/* TODO: add author
<p class="f6 lh-copy mv0">By {{ .Author }}</p> */}}
</div>
</div>
</a>
</article>