summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Whitlock <adam@adamwhitlock.com>2021-12-31 14:49:31 -0600
committerAdam Whitlock <adam@adamwhitlock.com>2021-12-31 14:49:31 -0600
commit7f8537f23a66600e392a5c90c2f032edbf93fde5 (patch)
treeba9249e25df8ace4432421322650839d7ef201d7
parent14336900e72b70aa358cbe0b7b2e31eb17190d0a (diff)
Pictures work on pages, looks tight
Added the ability to pull a header.jpg from content bags for site layout. Added date to front page
-rw-r--r--layouts/_default/single.html6
-rw-r--r--layouts/index.html8
2 files changed, 12 insertions, 2 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index c847a2b..c5e5c54 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,6 +1,12 @@
{{ define "main"}}
<main aria-role="main">
<div class="content is-normal mx-3">
+ <figure class="image ">
+ {{ with .Resources.GetMatch "header.jpg" }}
+ <img src="data:{{ .MediaType }};base64,{{ .Content | base64Encode }}">
+ {{ end }}
+ </figure>
+
<p class="title is-3"><i class="fas fa-file"></i> {{.Page.Title}}</p>
<p class="subtitle is-4">{{.Page.Description}}</p>
{{ $dateFormat := .Site.Params.dateFormat | default "January 2, 2006"}}
diff --git a/layouts/index.html b/layouts/index.html
index c78cd09..dbe7f21 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -5,10 +5,13 @@
<div class="container">
<!-- first post content -->
- {{ range first 3 (where (where .Site.RegularPages "Type" "blog") "File.Dir" "archive/") }}
+ {{ range first 3 (where .Site.RegularPages "Type" "blog") }}
<div class="columns">
<div class="column">
- <figure class="image">
+ <figure class="image ">
+ {{ with .Resources.GetMatch "header.jpg" }}
+ <img src="data:{{ .MediaType }};base64,{{ .Content | base64Encode }}">
+ {{ end }}
</figure>
</div>
</div>
@@ -18,6 +21,7 @@
<div class="column">
<div class="content">
<h1 class="title"><a class="" href="{{ .RelPermalink }}"> {{ .Title }}</a></h1>
+ <h2 class="subtitle is-5"><time>{{ .Date.Format "Jan 2, 2006" }}</time></h2>
<p>{{ .Summary }}</p>
{{ if .Truncated }}
<div>