mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-21 22:36:16 +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>
|
</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
|
||||||
|
|
Loading…
Reference in a new issue