From 2dfd95729613ce84d54a3a3ddcfff8b832186213 Mon Sep 17 00:00:00 2001
From: Bud Parr <budparr@gmail.com>
Date: Sat, 15 Apr 2017 01:58:31 +0000
Subject: [PATCH] clean up

---
 layouts/_default/list.html              |    8 +
 layouts/_default/single.html            |   19 ++--
 layouts/section/article.html            |   10 +-
 layouts/index.html                      |   69 ++++++----------
 layouts/shortcodes/form-contact.html    |   43 ++++++++++
 layouts/article/single.html             |   14 +-
 layouts/article/summary-with-image.html |   19 ++++
 layouts/article/summary.html            |    5 
 8 files changed, 117 insertions(+), 70 deletions(-)

diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 6ca0963..cf7fdb5 100755
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,14 +1,16 @@
 {{ define "main" }}
   <article class="cf pa3 pa4-m pa4-l">
-    <div class="measure-wide-l center nested-copy-line-height nested-links nested-img mid-gray ">
+    <div class="measure-wide-l center f4 lh-copy nested-copy-line-height nested-links nested-img mid-gray">                
       {{ .Content }}
     </div>
   </article>
-  <div class="measure-wide-l center">
+  <div class="mw8 center">
     {{ $section := where .Data.Pages "Section" .Section }}
     <section class="flex-ns flex-wrap justify-around mt5">
       {{ range  $section }}
-        {{ partial "summary.html" . }}
+        <div class="relative w-100  mb4 bg-white">
+          {{ partial "summary.html" . }}
+        </div>
       {{ end }}
     </section>
   {{ template "_internal/pagination.html" . }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index fe90663..9f7d553 100755
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,19 +1,18 @@
 {{ define "header" }}{{ partial "page-header.html" . }}{{ end }}
 {{ define "main" }}
-  {{ $currentPageUrl := .URL }}
-  <div class="flex mt5 mw8 center">
-    <article class="pv5">
-      <h4 class="f6">
+  <div class="flex-l mt2 mw8 center">
+    <article class="center cf pv5 ph3 ph4-ns mw7">
+      <p class="f6 b helvetica tracked">
         {{ humanize .Section | upper  }}
-      </h4>
-      <h1>
+      </p>
+      <h1 class="f1">
         {{ .Title }}
       </h1>
-      <div class="nested-copy-line-height f4 nested-linkfs nested-img mid-gray measure-wide-l">
-        {{ .Content  }}
-      </div>
+      <section class="nested-copy-line-height lh-copy f4 nested-links nested-img mid-gray">
+        {{ .Content | markdownify }}
+      </section>
     </article>
-    <div class="ph4 mt6">
+    <div class="ph3 mt2 mt6-ns">
       {{ partial "menu-contextual.html" . }}
     </div>
   </div>
diff --git a/layouts/article/single.html b/layouts/article/single.html
index cf06681..8e9f3c1 100644
--- a/layouts/article/single.html
+++ b/layouts/article/single.html
@@ -1,8 +1,8 @@
 {{ define "header" }}{{ partial "page-header.html" . }}{{ end }}
 {{ define "main" }}
-  <div class="flex-l mt5 mw8 center">
-    <article class="center cf pv5 ph3 mw7">
-      <p class="f6 fw8">
+  <div class="flex-l mt2 mw8 center">
+    <article class="center cf pv5 ph3 ph4-ns mw7">
+      <p class="f6 b helvetica tracked">
         {{ humanize .Section | upper  }}
       </p>
       <h1 class="f1 athelas">
@@ -10,14 +10,14 @@
       </h1>
         {{/* TODO: Add Hugo author  */}}
       <time class="f6 mv4 dib tracked" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
-          {{ .Date.Format "January 2, 2006" }}
+        {{ .Date.Format "January 2, 2006" }}
       </time>
-      <section class="nested-copy-line-height lh-copy serif f4 measure-wide-l nested-links nested-img mid-gray">
-          {{ .Content | markdownify }}
+      <section class="nested-copy-line-height lh-copy serif f4 nested-links nested-img mid-gray">
+        {{ .Content | markdownify }}
       </section>
       {{ partial "tags.html" . }}
     </article>
-    <div class="ph4 mt6">
+    <div class="ph3 mt2 mt6-ns">
       {{ partial "menu-contextual.html" . }}
     </div>
   </div>
diff --git a/layouts/article/summary-with-image.html b/layouts/article/summary-with-image.html
new file mode 100644
index 0000000..2831ae1
--- /dev/null
+++ b/layouts/article/summary-with-image.html
@@ -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>
diff --git a/layouts/article/summary.html b/layouts/article/summary.html
index b57becd..b51e3ec 100644
--- a/layouts/article/summary.html
+++ b/layouts/article/summary.html
@@ -1,5 +1,5 @@
-<div class="relative w-100 w-30-l mb4 bg-white nested-copy-line-height">
-  <div class="bg-white mb3 pa4 gray overflow-hidden">
+
+  <div class="mb3 pa4 gray overflow-hidden">
     {{ if .Date }}
       <date class="f6">
         {{ .Date.Format "January 2, 2006" }}
@@ -16,4 +16,3 @@
       </p>
     </div>
   </div>
-</div>
diff --git a/layouts/index.html b/layouts/index.html
index d0b326a..d57e3d5 100755
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,53 +1,36 @@
 {{ define "main" }}
-
-  <main class="cf ph3 ph5-l pv3 pv4-l f4 tc 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 }}
-
   </main>
 
+  <div class="pa3 pa4-ns w-100 w-70-ns center">
+    <h1 class="flex-none">
+      Recent Articles
+    </h1>
 
-  <div class="pa3 pa4-ns w-70 center">
 
-  <h1 class="flex-none db">Recent Articles</h1>
+      {{/* Create a variable to use the same section twice. Note that we've included the date here. */}}
+    {{ $section := where .Data.Pages.ByDate.Reverse "Section" "article" }}
+      <section class="w-100 mw8">
+        {{ range (first 3 $section)   }}
+          <div class="relative w-100 mb4">
+            {{ .Render "summary-with-image" }}
+          </div>
+        {{ end }}
+      </section>
 
-  <div class="flex">
-    {{ $section := where .Data.Pages "Section" "article" }}
-
-    <section class="w-60 pa4 bg-white">
-      {{ range sort (first 1 $section) "Date" "desc"  }}
-      {{ if .Date }}
-        <date class="f6">
-          {{ .Date.Format "January 2, 2006" }}
-        </date>
-      {{ end }}
-      <h2 class="f3 near-black">
-        <a href="{{ .URL }}" class="link black dim">
-          {{ .Title }}
-        </a>
-      </h2>
-      <div class="nested-links f5 nested-copy-line-height">
-        <p>
-          {{ .Summary  }}
-        </p>
-      </div>
-      {{ end }}
-    </section>
-
-    <section class="w-30 ph4">
-      {{ range sort (first 4 (after 1 $section)) "Date" "desc"  }}
-        <h2 class="f5 fw4 mb4">
-        <a href="{{ .URL }}" class="link black dim">
-          {{ .Title }}
-        </a>
-        </h2>
-      {{ end }}
-    </section>
-
+      <section class="w-100">
+        <h1 class="f3">More posts</h1>
+        {{/* Nest the requirements, "after" then "first" on the outside */}}
+        {{ range (first 4 (after 1 $section))  }}
+          <h2 class="f5 fw4 mb4 dib mr3">
+            <a href="{{ .URL }}" class="link black dim">
+              {{ .Title }}
+            </a>
+          </h2>
+        {{ end }}
+        <a href="/article/" class="link db f6 pa2 br3 bg-mid-gray white dim w4 tc">All Posts</a>
+      </section>
 
     </div>
-    </div>
-
-
-
-
 {{ end }}
diff --git a/layouts/section/article.html b/layouts/section/article.html
index 09446ee..3acc693 100644
--- a/layouts/section/article.html
+++ b/layouts/section/article.html
@@ -1,12 +1,14 @@
 {{ define "main" }}
   <article class="pa3 pa4-ns nested-copy-line-height nested-img">
-    <div class="{{ .Site.Params.copyClass }}">
-      {{ .Content }}
-    </div>
+  <main class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy mid-gray">
+    {{ .Content }}
+  </main>
     {{ $section := .Paginate (where .Data.Pages "Section" .Section) }}
     <section class="flex-ns flex-wrap justify-around mt5">
       {{ range  $section.Pages }}
-        {{ .Render "summary" }}
+        <div class="relative w-100 w-30-l mb4 bg-white">
+          {{ .Render "summary" }}
+        </div>
       {{ end }}
     </section>
     {{ template "_internal/pagination.html" . }}
diff --git a/layouts/shortcodes/form-contact.html b/layouts/shortcodes/form-contact.html
new file mode 100644
index 0000000..b820a16
--- /dev/null
+++ b/layouts/shortcodes/form-contact.html
@@ -0,0 +1,43 @@
+{{/* <form class="black-80" accept-charset="UTF-8" action="{{ .Get "action" }}" method="POST">
+  <div class="measure">
+    <label for="name" class="f6 b db mb2">Name <span class="normal black-60">(optional)</span></label>
+    <input id="name" class="input-reset ba b--black-20 pa2 mb2 db w-100" type="text" aria-describedby="name-desc">
+    <small id="name-desc" class="f6 black-60 db mb2">Helper text for the form control.</small>
+
+    <label for="email" class="f6 b db mb2">Email Address</label>
+    <input id="email" class="input-reset ba b--black-20 pa2 mb2 db w-100" type="text" aria-describedby="email-desc">
+    <small id="email-desc" class="f6 black-60 db mb2">Helper text for the form control.</small>
+
+    <label for="email" class="f6 b db mb2">Name <span class="normal black-60">(optional)</span></label>
+    <input id="name" class="input-reset ba b--black-20 pa2 mb2 db w-100" type="text" aria-describedby="name-desc">
+    <small id="name-desc" class="f6 black-60 db mb2">Helper text for the form control.</small>
+  </div>
+</form> */}}
+{{ $.Scratch.Add "labelClasses" "f6 b db mb1 mt3 sans-serif mid-gray" }}
+{{ $.Scratch.Add "inputClasses" "w-100 f5 pv3 ph3 bg-light-gray bn" }}
+
+<form class="black-80 sans-serif" accept-charset="UTF-8" action="{{ .Get "action" }}" method="POST">
+
+    <label class="{{ $.Scratch.Get "labelClasses" }}"  for="first_name">Your Name</label>
+    <input type="text" id="first_name" name="first_name" class="{{ $.Scratch.Get "inputClasses" }}"  required placeholder=" " />
+
+
+
+    <label class="{{ $.Scratch.Get "labelClasses" }}" for="last_name">Organization Name</label>
+    <input type="text" id="last_name" name="last_name" class="{{ $.Scratch.Get "inputClasses" }}"  required placeholder=" " />
+
+
+
+    <label class="{{ $.Scratch.Get "labelClasses" }}" for="email">Email Address</label>
+    <input type="email" id="email" name="email" class="{{ $.Scratch.Get "inputClasses" }}"  required placeholder=" " />
+    <div class="requirements f6 gray glow i ph3 overflow-hidden TK">
+      Must be a valid email address.
+    </div>
+
+
+    <label class="{{ $.Scratch.Get "labelClasses" }}" for="message">Message</label>
+    <textarea id="message" name="message" class="{{ $.Scratch.Get "inputClasses" }} h4" aria-describedby="comment-desc"></textarea>
+
+    <input class="db w-100 mv2 white pa3 bn hover-shadow hover-bg-blck bg-animate bg-black" type="submit" value="Send" />
+
+</form>

--
Gitblit v1.10.0