Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Sitemap gives 1,003 generated reference pages a lastmod of 0001-01-01

オープン 初心者向け
#26,373 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
hugo
領域
documentation

調査の方向性

まず layouts/sitemap.xml から始め、次に content/reference/cli/_content.gotmpl によって生成されるページと Hugo の GitInfo の動作を調べます。テンプレートを変更する前に、生成された sitemap.xml を実行するか確認します。完了とは、生成されたリファレンスページが <lastmod> を 0001-01-01 として公開しなくなり、有効な日付はそのまま維持されることです。この課題には以前のクローズされた pull request と代替案が言及されているため、アプローチをメンテナーと確認してください。

索引モデルが issue の本文から書いたものです。

説明

status/triage
Is this a docs issue?
  • My issue is about the documentation content or website
Type of issue

There's a problem with the website

Description

The sitemap gives 1,003 of its 2,204 entries a <lastmod> of 0001-01-01. For example, docker container run:

<loc>https://docs.docker.com/reference/cli/docker/container/run/</loc>
<lastmod>0001-01-01</lastmod>

Every affected page is a generated reference page: the docker and sbx CLI references, and the Sandboxes, Hub, DVP, AI Governance and Registry API references. Anything that reads the sitemap takes that date at face value, so these pages look like they never change.

As far as I can tell, the cause is that these pages are built by Hugo content adapters such as content/reference/cli/_content.gotmpl, so they have no file in git. With enableGitInfo: true, Hugo takes Lastmod from git, so for these pages it stays at Go's zero time, and layouts/sitemap.xml prints it as is.

Location

https://docs.docker.com/sitemap.xml

Suggestion

One fix is to leave <lastmod> out when the date is zero, which is what Hugo's embedded sitemap template does. The element is optional in the sitemap protocol.

I opened #26365 with that change before filing an issue, which in hindsight was the wrong order. It's closed, and I'm filing this so the problem is tracked either way. I'm happy to rework it if you'd prefer a different approach, such as having the content adapters set a date, or to leave the fix to you.

主要言語
Markdown
スター
4.7k
フォーク
8.5k
平均マージ
2日 7時間
マージ済み PR(30日)
133

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

docker/docs のほかの issue

docker/docs の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。