Add featured image to template

This commit is contained in:
Thomas Smith 2023-03-27 13:01:46 -04:00
parent 8699911b49
commit 96cdabe6b2
2 changed files with 22 additions and 8 deletions

View file

@ -2,6 +2,7 @@
title: "Something New is Brewing" title: "Something New is Brewing"
date: 2022-03-23 date: 2022-03-23
draft: false draft: false
featured_image: "/Images/techcrunch-gen-art.jpg"
--- ---
I created Homebrew nearly 13 years ago out of sheer necessity. I found the tooling available to developers at the time haphazard and difficult to tease into shape. After complaining about it at the pub one evening, I was met with an exasperated “Max, quit whining and do something about it”. So I did. (Thanks Jono). I created Homebrew nearly 13 years ago out of sheer necessity. I found the tooling available to developers at the time haphazard and difficult to tease into shape. After complaining about it at the pub one evening, I was met with an exasperated “Max, quit whining and do something about it”. So I did. (Thanks Jono).

View file

@ -7,7 +7,7 @@
{{ partial "navbar.html" . }} {{ partial "navbar.html" . }}
<main style="height:100vh;"> <main>
<section class="teal-bg"> <section class="teal-bg">
<div class="container one-box"> <div class="container one-box">
<div class="row"> <div class="row">
@ -22,14 +22,18 @@
<div class="container blog-list two-boxes"> <div class="container blog-list two-boxes">
<div class="row"> <div class="row">
{{ range .Pages }} {{ range .Pages }}
<div class="col-4 mb-5"> <div class="col-4 mb-4">
<div class="blog-listing"> <a href="{{ .RelPermalink }}">
<a class="display-6" href="{{ .RelPermalink }}">{{ .Title }}</a><br> <div class="blog-listing p-3 pb-5">
<span class="grid-gray">{{ .Date.Format "2006-01-02" }}</span> {{ if .Params.featured_image }}
<span class="preview-content">{{ .Content }}</span> <img class="featured-image mb-3" src="{{ .Params.featured_image }}" alt="{{ .Title }}" />
{{ end }}
<a class="display-6" href="{{ .RelPermalink }}">{{ .Title }}</a><br>
<span class="grid-gray">{{ .Date.Format "2006-01-02" }}</span>
<span class="preview-content">{{ .Content }}</span>
</div>
</a>
</div> </div>
</div>
{{ end }} {{ end }}
<a href="/">Back to home</a> <a href="/">Back to home</a>
</div> </div>
@ -51,6 +55,15 @@
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.featured-image {
width: 100%; /* Adjust the width as needed */
height: 100px; /* Maintain the image's aspect ratio */
}
.blog-listing{
border: 1px solid #949494;
}
</style> </style>
</html> </html>