rename some image variables; rss default show content

This commit is contained in:
Reorx 2022-05-08 01:24:38 +08:00
parent 4f722e0c6d
commit 0d2d905e3b
4 changed files with 15 additions and 15 deletions

View File

@ -16,10 +16,10 @@
<title>{{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ site.Title }}</description>
{{- with site.Params.images }}
{{- with site.Params.logo }}
<image>
<url>{{ index . 0 | absURL }}</url>
<link>{{ index . 0 | absURL }}</link>
<url>{{ .icon | absURL }}</url>
<link>{{ .icon | absURL }}</link>
</image>
{{- end }}
<generator>Hugo -- gohugo.io</generator>{{ with site.LanguageCode }}
@ -40,7 +40,7 @@
{{ with site.Author.email }}<author>{{.}}{{ with site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}}</description>
{{- if site.Params.ShowFullTextinRSS }}
{{- if not site.Params.RSSNoContent}}
<content:encoded>{{ (printf "<![CDATA[%s]]>" .Content) | safeHTML }}</content:encoded>
{{- end }}
</item>

View File

@ -60,7 +60,7 @@
{{- end }}
{{- /* Favicons */}}
<link rel="icon" href="{{ site.Params.assets.favicon | default "favicon.ico" | absURL }}">
<link rel="icon" href="{{ site.Params.favicon | default "favicon.ico" | absURL }}">
{{- /* RSS */}}
{{ range .AlternativeOutputFormats -}}

View File

@ -42,11 +42,11 @@
<header class="header">
<nav class="nav">
<div class="logo">
{{- $label_text := (site.Params.label.text | default site.Title) }}
{{- $label_text := (site.Params.logo.text | default site.Title) }}
{{- if site.Title }}
<a href="{{ "" | absURL }}" accesskey="h" title="{{ $label_text }} (Alt + H)">
{{- if site.Params.label.icon }}
{{- $img := resources.Get site.Params.label.icon }}
{{- if site.Params.logo.icon }}
{{- $img := resources.Get site.Params.logo.icon }}
{{- if $img }}
{{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}}
{{- if hugo.IsExtended -}}
@ -54,17 +54,17 @@
{{- end -}}
{{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }}
{{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}}
{{- if site.Params.label.iconHeight }}
{{- $img = $img.Resize (printf "x%d" site.Params.label.iconHeight) }}
{{- if site.Params.logo.iconHeight }}
{{- $img = $img.Resize (printf "x%d" site.Params.logo.iconHeight) }}
{{ else }}
{{- $img = $img.Resize "x30" }}
{{- end }}
{{- end }}
<img src="{{ $img.Permalink }}" alt="logo" aria-label="logo"
height="{{- site.Params.label.iconHeight | default "30" -}}">
height="{{- site.Params.logo.iconHeight | default "30" -}}">
{{- else }}
<img src="{{- site.Params.label.icon | absURL -}}" alt="logo" aria-label="logo"
height="{{- site.Params.label.iconHeight | default "30" -}}">
<img src="{{- site.Params.logo.icon | absURL -}}" alt="logo" aria-label="logo"
height="{{- site.Params.logo.iconHeight | default "30" -}}">
{{- end -}}
{{- end -}}
{{- $label_text -}}

View File

@ -7,7 +7,7 @@
"name": {{ site.Title }},
"url": {{ site.BaseURL }},
"description": {{ site.Params.description | plainify | truncate 180 | safeHTML }},
"thumbnailUrl": {{ site.Params.assets.favicon | default "favicon.ico" | absURL }},
"thumbnailUrl": {{ site.Params.favicon | default "favicon.ico" | absURL }},
"sameAs": [
{{- if site.Params.schema.sameAs }}
{{ range $i, $e := site.Params.schema.sameAs }}{{ if $i }}, {{ end }}{{ trim $e " " }}{{ end }}
@ -109,7 +109,7 @@
"name": {{ site.Title }},
"logo": {
"@type": "ImageObject",
"url": {{ site.Params.assets.favicon | default "favicon.ico" | absURL }}
"url": {{ site.Params.favicon | default "favicon.ico" | absURL }}
}
}
}