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

解决sitemap有重复loc的问题 #3161

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

解决sitemap有重复loc的问题 #3161

wants to merge 21 commits into from

Conversation

pei92
Copy link

@pei92 pei92 commented Jan 17, 2025

尽量按此模板PR内容,或粘贴相关的ISSUE链接。

已知问题

1.sitemap有重复loc

解决方案

1.如果有相同的ioc,只取日期最新的

具体改动

  1. sitemap.xml.js
    • 如果有相同的ioc,只取日期最新的
    • 引入了 getUniqueFields 函数,该函数利用 Map 来确保每个 loc 只有一个条目,并且只保留 lastmod 最新的条目

测试确认

  • [√] 本地开发环境测试通过
  • [√] 生产环境构建测试通过

Copy link

vercel bot commented Jan 17, 2025

@pei92 is attempting to deploy a commit to the tangly1024's projects Team on Vercel.

A member of the Team first needs to authorize it.

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 this pull request may close these issues.

1 participant