Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

HTML sitemap lists unpublished pages

已关闭 适合新手
#883 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@KrzysztofPajak 已经在做这个了。

开始于 2026年10月7日。

  • #884 来自 @KrzysztofPajak —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp
领域
backend

调研方向

从 src/Web/Grand.Web/Features/Handlers/Common/GetSitemapHandler.cs 中的页面块入手,并将其筛选条件与 src/Business/Grand.Business.Messages/Commands/Handlers/Common/GetSitemapXMLCommandHandler.cs 中 XML 站点地图处理程序的筛选条件进行比较。在 Features/Handlers/Pages/GetPageBlockHandler.cs 中检查相关页面行为。完成标准是 /sitemap 排除未发布的页面,同时保留所述的站点地图和日期筛选条件;通过相关测试或使用一个未发布页面进行复现来验证该行为。

由索引模型根据 Issue 内容生成。

描述

What happens

The storefront HTML sitemap (/sitemap) lists CMS pages that are not published. The title of an unpublished page is shown publicly, and its link leads nowhere because the page itself checks Published and does not render.

Steps to reproduce

  1. In the admin panel create a page, tick "Include in sitemap" and leave "Published" unticked.
  2. Open /sitemap on the storefront.
  3. The page is listed under the pages section; following the link does not show the page.

Cause

src/Web/Grand.Web/Features/Handlers/Common/GetSitemapHandler.cs (pages block, around lines 110-114) takes pages from IPageService.GetAllPages(storeId), which does not filter on Published, and then filters only on IncludeInSitemap and the start/end dates.

The XML sitemap already does this correctly: src/Business/Grand.Business.Messages/Commands/Handlers/Common/GetSitemapXMLCommandHandler.cs (around line 332) filters on t.Published && t.IncludeInSitemap && .... The page view enforces Published in Features/Handlers/Pages/GetPageBlockHandler.cs.

Expected behaviour

Only published pages with "Include in sitemap" ticked (and within their start/end dates) appear on /sitemap, consistent with the XML sitemap.

主要语言
C#
星标
1.3k
派生
549
平均合并
8 小时 14 分钟
30 天内合并 PR
55

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

grandnode/grandnode2 的其他 Issue

查看 grandnode/grandnode2 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。