mirror of
https://github.com/naoufalzerai/zerai.xyz.git
synced 2025-12-24 22:43:58 +00:00
change theme again :D
This commit is contained in:
17
themes/notepadium/layouts/partials/twitter-card.html
Normal file
17
themes/notepadium/layouts/partials/twitter-card.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="{{- .Title -}}" />
|
||||
{{- $imgurl := "" -}}
|
||||
|
||||
{{- if .Params.cover -}}
|
||||
{{- $imgurl = .Params.cover -}}
|
||||
{{- else if .Params.imgs -}}
|
||||
{{- $imgurl = index .Params.imgs 0 -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if gt (len $imgurl) 0 -}}
|
||||
{{- $imgurl = lower $imgurl -}}
|
||||
{{- if and (not (hasPrefix $imgurl "http://")) (not (hasPrefix $imgurl "https://")) -}}
|
||||
{{- $imgurl = print .Permalink $imgurl -}}
|
||||
{{- end -}}
|
||||
<meta name="twitter:image" content="{{- $imgurl -}}" />
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user