using .Page.Description instead of .Page.Params.heading
[kengrimes.com/theme.git] / layouts / _default / baseof.html
index 3f7a35d..ddfb8b0 100644 (file)
     <header>
       {{- $sp := .Site.GetPage "section" .Section }}
       {{- $sh := cond (or (not $sp.Params.header) (not (fileExists (printf "static/%s" $sp.Params.header)))) (cond (or (not .Site.Home.Params.header) (not (fileExists (printf "static/%s" .Site.Home.Params.header)))) "/img/speedy.png" .Site.Home.Params.header) $sp.Params.header }}
-      {{- $sc := cond (or (not $sp.Params.caption)) (cond (not .Site.Home.Params.caption) .Site.Title .Site.Home.Params.caption) $sp.Params.caption }}
       {{- $ph := cond (or (not .Params.header) (not (fileExists (printf "static/%s" .Params.header)))) $sh .Params.header }}
       <img src="{{ $ph }}">
       <div>
-        {{ $caption := cond (not .Params.caption) $sc .Params.caption }}
-        {{- if (eq (printf "%T" $caption) "string") }}
-        {{- $caption -}}
-        {{- else }}
-        {{- index $caption 0 }}
-        {{- if (gt (len $caption) 1) }}
-        {{- range after 1 $caption -}}
-        <br>
-        {{ . }}
-        {{- end -}}
-        {{- end -}}
-        {{- end }}
+        <p>
+          {{- if not .Page.Description }}
+          {{ .Page.Title }}
+          {{- else }}
+          {{ replaceRE "\n\n" "<br>\n" .Page.Description | safeHTML }}
+          {{- end }}
+        </p>
       </div>
     </header>
     <nav>
         {{- $pg := . }}
         {{- range .Site.Menus.main }}
         <a href="{{ absURL .URL }}">
-          <summary>{{ .Name }}</summary>
+          <summary>{{ .Title }}</summary>
           <svg{{- if or ($pg.InSection .Page) (eq .Page $pg) }} class="selected"{{ end }}>
-            <use xlink:href="{{ relURL `/img/nav.svg` | safeHTML }}#{{ .Name }}"/>
+            <use xlink:href="{{ relURL `/img/nav.svg` | safeHTML }}#{{ .Title }}"/>
           </svg>
         </a>
         {{- end }}
       </div>
       <footer>
-        {{ cond (not .Page.Title) .Page.Name .Page.Title }}
+        {{ cond (not $sp.Params.menu.main.title) $sp.Title $sp.Params.menu.main.title }}
       </footer>
     </nav>
-    <main>
+    <article>
       {{ block "main" . }}{{ end }}
-    </main>
+    </article>
     <footer>
       <p>&copy;{{ .Site.Copyright }}</p>
     </footer>