Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR deprecated: .Site.LastChange was deprecated #21

Closed
fintinc opened this issue Oct 24, 2024 · 1 comment · Fixed by #23
Closed

ERROR deprecated: .Site.LastChange was deprecated #21

fintinc opened this issue Oct 24, 2024 · 1 comment · Fixed by #23

Comments

@fintinc
Copy link

fintinc commented Oct 24, 2024

Description

ERROR deprecated: .Site.LastChange was deprecated in Hugo v0.123.0 and will be removed in Hugo 0.137.0. Use .Site.Lastmod instead.

in this file:
layouts/sitemapindex.xml

lines 6 and 7

.LastChange should be replaced by .Lastmod

{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} 
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> 
  {{ range . }} 
  <sitemap> 
    <loc>{{ .SitemapAbsURL }}</loc> 
    {{ if not .LastChange.IsZero }} 
      <lastmod>{{ .LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod> 
    {{ end }} 
  </sitemap>  
  {{ end }} 
</sitemapindex> 
{{/* Source: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/sitemapindex.xml */}}
hugo v0.136.3+extended
@h-enk h-enk linked a pull request Oct 24, 2024 that will close this issue
4 tasks
@h-enk
Copy link
Member

h-enk commented Oct 24, 2024

Thanks!

@h-enk h-enk closed this as completed in #23 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants