mirror of
https://github.com/yuzu-emu/shared-bulma-theme.git
synced 2024-12-22 19:35:28 +00:00
layouts: use Hugo to process game icons and banners
This commit is contained in:
parent
a94bfba031
commit
c497835859
|
@ -3,8 +3,8 @@
|
|||
<meta property="og:description" content="{{ $rating.name }} - {{ $rating.description }}" />
|
||||
<meta name="description" content="{{ $rating.name }} - {{ $rating.description }}" />
|
||||
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="{{ .Site.BaseURL }}/images/game/icons/{{ .File.BaseFileName }}.png" />
|
||||
<meta property="og:type" content="article" />{{- $fn := printf "/images/game/icons/%s.png" .File.BaseFileName -}}{{- $icon := resources.Get $fn -}}
|
||||
{{ with $icon }}{{- $thumb := .Fill "48x48 jpg" | resources.Copy (printf "%s.jpg" $fn) -}}<meta property="og:image" content="{{ $thumb.Permalink }}" />{{ end }}
|
||||
<meta property="og:article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}" />
|
||||
{{ range .Params.tags }}
|
||||
<meta property="og:article:tag" content="{{ . }}" />
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
<loc>{{ .Permalink }}</loc>
|
||||
|
||||
{{ if (eq .Section "entry") }}
|
||||
<image:image>
|
||||
<image:loc>{{ .Site.BaseURL }}/images/banners/{{ .Params.Banner | default (print .File.BaseFileName ".png") }}</image:loc>
|
||||
{{ if (eq .Section "entry") }}{{- $banner_fn := .Params.Banner | default (print .File.BaseFileName ".png") -}}
|
||||
<image:image>{{- $fn := printf "/images/banners/%s" $banner_fn -}}{{- $banner := resources.Get $fn -}}
|
||||
{{ with $banner }}<image:loc>{{- $thumb := .Fit "824x306 jpg" | resources.Copy (printf "%s.jpg" $fn) -}}{{ $thumb.Permalink }}</image:loc>{{ end }}
|
||||
</image:image>
|
||||
{{ else if (eq .Section "game") }}
|
||||
<image:image>
|
||||
<image:loc>{{ .Site.BaseURL }}/images/game/icons/{{ .File.BaseFileName }}.png</image:loc>
|
||||
<image:image>{{- $fn := printf "/images/game/icons/%s.png" .File.BaseFileName -}}{{- $icon := resources.Get $fn -}}
|
||||
{{ with $icon }}<image:loc>{{- $thumb := .Fill "48x48 jpg" | resources.Copy (printf "%s.jpg" $fn) -}}{{ $thumb.Permalink }}</image:loc>{{ end }}
|
||||
</image:image>
|
||||
{{ end }}
|
||||
|
||||
|
|
Loading…
Reference in a new issue