mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-21 14:26:17 +01:00
feat(sitemap): improve priority (#392)
Co-authored-by: Dillon <dillonzq@outlook.com>
This commit is contained in:
parent
7b954a46e4
commit
2242e0c3c7
1 changed files with 9 additions and 3 deletions
|
@ -17,11 +17,17 @@
|
|||
{{- . -}}
|
||||
</changefreq>
|
||||
{{- end -}}
|
||||
|
||||
{{- if ge .Sitemap.Priority 0.0 -}}
|
||||
<priority>
|
||||
{{- .Sitemap.Priority -}}
|
||||
</priority>
|
||||
{{- $weeks := div (sub now.Unix .Lastmod.Unix) 604800 -}}
|
||||
{{- $priority := sub 1 (div $weeks 10.0 ) -}}
|
||||
{{- if ge .Sitemap.Priority $priority -}}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>
|
||||
{{- else -}}
|
||||
<priority>{{ $priority }}</priority>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if .IsTranslated -}}
|
||||
{{- range .Translations -}}
|
||||
<xhtml:link
|
||||
|
|
Loading…
Reference in a new issue