feat(sitemap): improve priority (#392)
Co-authored-by: Dillon <dillonzq@outlook.com>
This commit is contained in:
@@ -17,11 +17,17 @@
|
|||||||
{{- . -}}
|
{{- . -}}
|
||||||
</changefreq>
|
</changefreq>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if ge .Sitemap.Priority 0.0 -}}
|
{{- if ge .Sitemap.Priority 0.0 -}}
|
||||||
<priority>
|
{{- $weeks := div (sub now.Unix .Lastmod.Unix) 604800 -}}
|
||||||
{{- .Sitemap.Priority -}}
|
{{- $priority := sub 1 (div $weeks 10.0 ) -}}
|
||||||
</priority>
|
{{- if ge .Sitemap.Priority $priority -}}
|
||||||
|
<priority>{{ .Sitemap.Priority }}</priority>
|
||||||
|
{{- else -}}
|
||||||
|
<priority>{{ $priority }}</priority>
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if .IsTranslated -}}
|
{{- if .IsTranslated -}}
|
||||||
{{- range .Translations -}}
|
{{- range .Translations -}}
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
|
|||||||
Reference in New Issue
Block a user