Fix: Image meta should work now in the index page too

This fixes the image tag not working in the index page.

Fixes #3
remotes/oscarmlage/main
Óscar M. Lage 2022-03-31 20:38:07 +02:00
parent a41ab078dc
commit def4b4aa47
2 changed files with 12 additions and 2 deletions

View File

@ -22,8 +22,8 @@
- [x] About, Colophon, CV... - [x] About, Colophon, CV...
- [x] Add dotfiles to the resume - [x] Add dotfiles to the resume
- [x] Add segun to the colophon - [x] Add segun to the colophon
- [x] Take a look to the twitter-card/og for the index page
- [ ] RSS - [ ] RSS
- [ ] Take a look to the twitter-card/og for the index page
- [ ] Add vim + productivity to "hobbies" or "tools" section - [ ] Add vim + productivity to "hobbies" or "tools" section
- [ ] General review + Clean some stuff here and there - [ ] General review + Clean some stuff here and there
- [ ] Some images contains a `<p>`, get rid of it. - [ ] Some images contains a `<p>`, get rid of it.

View File

@ -37,7 +37,9 @@
<meta itemprop="url" content="{{ .URL | absURL }}"> <meta itemprop="url" content="{{ .URL | absURL }}">
<meta itemprop="datePublished" content="{{ .PublishDate }}"> <meta itemprop="datePublished" content="{{ .PublishDate }}">
<meta itemprop="dateModified" content=" {{ .Lastmod }}"> <meta itemprop="dateModified" content=" {{ .Lastmod }}">
{{- if .Params.image }} {{ if eq .Name "oscarmlage" }}
<meta itemprop="image" content="{{ .URL | absURL }}apple-touch-icon-png">
{{- else }}
<meta itemprop="image" content="{{ .URL | absURL }}{{ .Params.image }}"> <meta itemprop="image" content="{{ .URL | absURL }}{{ .Params.image }}">
{{- end }} {{- end }}
@ -47,7 +49,11 @@
<meta property="og:title" content="{{ .Title }}"> <meta property="og:title" content="{{ .Title }}">
<meta property="og:description" content="{{ .Content | plainify | htmlUnescape | truncate 100 }}"> <meta property="og:description" content="{{ .Content | plainify | htmlUnescape | truncate 100 }}">
<meta property="og:url" content="{{ .URL | absURL }}"> <meta property="og:url" content="{{ .URL | absURL }}">
{{- if eq .Name "oscarmlage" }}
<meta property="og:image" content="{{ .URL | absURL }}apple-touch-icon.png">
{{- else }}
<meta property="og:image" content="{{ .URL | absURL }}{{ .Params.image }}"> <meta property="og:image" content="{{ .URL | absURL }}{{ .Params.image }}">
{{- end }}
<!-- Twitter card --> <!-- Twitter card -->
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
@ -55,5 +61,9 @@
<meta name="twitter:site" content="{{ .Site.Title }}"> <meta name="twitter:site" content="{{ .Site.Title }}">
<meta name="twitter:title" content="{{ .Title }}"> <meta name="twitter:title" content="{{ .Title }}">
<meta name="twitter:description" content="{{ .Content | plainify | htmlUnescape | truncate 100 }}"> <meta name="twitter:description" content="{{ .Content | plainify | htmlUnescape | truncate 100 }}">
{{- if eq .Name "oscarmlage" }}
<meta name="twitter:image" content="{{ .URL | absURL }}apple-touch-icon.png">
{{- else }}
<meta name="twitter:image" content="{{ .URL | absURL }}{{ .Params.image }}"> <meta name="twitter:image" content="{{ .URL | absURL }}{{ .Params.image }}">
{{- end }}
</head> </head>