Skip to content

Commit

Permalink
explicitly specify post thumbnail in the front matter
Browse files Browse the repository at this point in the history
  • Loading branch information
stebunovd committed Jan 3, 2025
1 parent 5d975dd commit df98e25
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions content/blog/three-steps/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Three important steps before jumping to the code
description: Once you decide which feature you want to build, it’s time to decide how to actually build it.
thumbnail: thumbnail.png
author: Denis Stebunov
date: 2024-07-08T14:37:00+0200
---
Expand Down
1 change: 1 addition & 0 deletions content/blog/why-go-full-stack/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Why go full-stack?
description: What does it mean to be a full-stack web developer today, and what are their pros and cons for team productivity?
thumbnail: why-go-full-stack.png
author: Denis Stebunov
date: 2023-02-01T12:40:00+0300
---
Expand Down
Binary file removed content/blog/why-go-full-stack/thumbnail.png
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Why public chats are better than direct messages
description: How we communicate makes an enormous impact on our work. One of the best strategies for improving communication in a team is making it open.
thumbnail: thumbnail.png
author: Denis Stebunov
date: 2022-09-07T17:38:00+0200
---
Expand Down
1 change: 1 addition & 0 deletions content/blog/zero-downtime-DB-migrations/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Migrating a production database without any downtime
description: The basic principles of zero-downtime DB migrations and quick recipes for the most common scenarios.
thumbnail: thumbnail.png
author: Denis Stebunov
date: 2024-10-16T14:32:00+0200
---
Expand Down
9 changes: 3 additions & 6 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@
<meta property="og:title" content="{{ .Title }}">
<meta property="og:description" content="{{ .Description }}">
<meta property="og:url" content="{{ .Permalink }}">
{{- $thumbnail := .Resources.GetMatch "thumbnail.png" }}
{{- $thumbnail2x := .Resources.GetMatch "[email protected]" }}
{{- if $thumbnail2x }}
{{- $thumbnail = $thumbnail2x }}}
{{- end }}
{{- if $thumbnail }}
{{- $page := . }}
{{- with .Params.thumbnail }}
{{- $thumbnail := $page.Resources.Get . }}
<meta property="og:image" content="{{ $thumbnail.Permalink }}">
<meta name="twitter:image" content="{{ $thumbnail.Permalink }}">
<meta name="twitter:card" content="summary_large_image">
Expand Down
9 changes: 5 additions & 4 deletions layouts/blog/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ <h1>Blog</h1>

{{- range $posts }}
<div class="blog--item">
{{- $thumbnail := .Resources.Get "thumbnail.png" }}
{{- if $thumbnail }}
<a href="{{ .RelPermalink }}">
{{- $page := . }}
{{- with .Params.thumbnail }}
{{- $thumbnail := $page.Resources.Get . }}
<a href="{{ $page.RelPermalink }}">
{{ partial "image.html" (dict
"Img" $thumbnail
"Class" "blog--item-thumbnail"
"Title" .Title
"Title" $page.Title
"Width" 450
) }}
</a>
Expand Down

0 comments on commit df98e25

Please sign in to comment.