Skip to content

Commit

Permalink
update og images
Browse files Browse the repository at this point in the history
  • Loading branch information
aviskase committed Feb 26, 2024
1 parent dc29e1d commit 2853c9b
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 12 deletions.
146 changes: 146 additions & 0 deletions feature_files/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ summaryLength = 50

[params]
description = "A blog by Yuliya Bagriy aka aviskase about testing, APIs, and other techy thingies."
images = ["site-feature.png"]
images = ["logo.png"]
title = "aviskase"
username = "aviskase"
firstname = "Yuliya"
Expand Down
1 change: 0 additions & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

{{ if ne .Kind "404" }}
{{ partial "opengraph.html" . }}
{{/* {{ template "_internal/twitter_cards.html" . }} */}}
{{ end }}
{{ hugo.Generator }}

Expand Down
17 changes: 7 additions & 10 deletions layouts/partials/opengraph.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
<meta property="profile:username" content="{{ .Site.Params.username }}" />
{{ end }}

{{ with $.Params.images }}{{ range first 6 . -}}
<meta property="og:image" content="{{ . | absURL }}" />
<meta property="og:image:height" content="630" />
<meta property="og:image:width" content="1200" />
{{ end }}{{ else -}}

{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
Expand All @@ -27,11 +23,10 @@
<meta property="og:image:width" content="1200" />
{{ else -}}
{{- with $.Site.Params.images -}}
{{- if not $isArticle }}
<meta property="og:image" content="{{ index . 0 | absURL }}"/>
<meta property="og:image:height" content="630" />
<meta property="og:image:width" content="1200" />
{{ end }}{{ end }}{{ end }}{{ end }}
<meta property="og:image:height" content="200" />
<meta property="og:image:width" content="200" />
{{ end }}{{ end }}

{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
{{- if $isArticle }}
Expand Down Expand Up @@ -64,4 +59,6 @@

{{- if $isArticle }}
<meta property="article:author" content="{{ ref . "pages/about" }}" />
{{ end }}
{{ end }}

<meta name="twitter:card" content="summary"/>
Binary file added static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2853c9b

Please sign in to comment.