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

Generated sitemaps aren't valid according to Google Search Console #22270

Closed
TheBrokenRail opened this issue Dec 29, 2022 · 2 comments · Fixed by #22272
Closed

Generated sitemaps aren't valid according to Google Search Console #22270

TheBrokenRail opened this issue Dec 29, 2022 · 2 comments · Fixed by #22272
Assignees
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Milestone

Comments

@TheBrokenRail
Copy link
Contributor

Description

As of v1.18, Gitea now generates sitemaps. So I updated my Gitea instance and loaded its sitemap into Google Search Console, and it threw a bunch of errors.

(I can't reproduce with https://try.gitea.io because Google Search Console only allows me to load sitemaps from domains I control, and I definitely don't control https://try.gitea.io.)

Gitea Version

v1.18

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Screenshot 2022-12-29 at 18-48-09 Sitemaps

Git Version

No response

Operating System

Linux

How are you running Gitea?

Docker Compose

Database

SQLite

@wolfogre wolfogre self-assigned this Dec 30, 2022
@wolfogre wolfogre added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Dec 30, 2022
@wolfogre wolfogre mentioned this issue Dec 30, 2022
lunny pushed a commit that referenced this issue Dec 30, 2022
Fix #22270.

Related to #18407.

The old code treated both sitemap and sitemap index as the format like:

```xml
...
<url>
  <loc>http://localhost:3000/explore/users/sitemap-1.xml</loc>
</url>
...
```

Actually, it's incorrect for sitemap index, it should be:

```xml
...
<sitemap>
  <loc>http://localhost:3000/explore/users/sitemap-1.xml</loc>
</sitemap>
...
```

See https://www.sitemaps.org/protocol.html

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: delvh <dev.lh@web.de>
@TheBrokenRail
Copy link
Contributor Author

Any chance this fix will be backported to v1.18.1? Thanks!

@jolheiser
Copy link
Member

Any chance this fix will be backported to v1.18.1? Thanks!

Yep, this will be backported!

@lunny lunny added this to the 1.18.1 milestone Jan 1, 2023
lunny added a commit that referenced this issue Jan 3, 2023
Backport #22272.

Fix #22270.

Related to #18407.

The old code treated both sitemap and sitemap index as the format like:

```xml
...
<url>
  <loc>http://localhost:3000/explore/users/sitemap-1.xml</loc>
</url>
...
```

Actually, it's incorrect for sitemap index, it should be:

```xml
...
<sitemap>
  <loc>http://localhost:3000/explore/users/sitemap-1.xml</loc>
</sitemap>
...
```

See https://www.sitemaps.org/protocol.html

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants