You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/advanced-configuration.rst
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,6 +139,35 @@ To exclude a set of pages, add each page's path to ``sitemap_exclude``:
139
139
"genindex.html",
140
140
]
141
141
142
+
.. _configuration_lastmod:
143
+
144
+
Configuring Last Modified Timestamps
145
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146
+
147
+
By default, the sitemap does not include ``<lastmod>`` elements.
148
+
To enable last modified timestamps in your sitemap, set :confval:`sitemap_show_lastmod` to ``True`` in **conf.py**:
149
+
150
+
.. code-block:: python
151
+
152
+
sitemap_show_lastmod =True
153
+
154
+
When enabled, the extension uses Git to determine the last modified date for each page based on the most recent commit that modified the source file.
155
+
This produces sitemap entries like:
156
+
157
+
.. code-block:: xml
158
+
159
+
<url>
160
+
<loc>https://my-site.com/docs/en/index.html</loc>
161
+
<lastmod>2024-01-15T10:30:00+00:00</lastmod>
162
+
</url>
163
+
164
+
.. note::
165
+
166
+
This feature requires Git to be available and your documentation to be in a Git repository.
167
+
If Git is not available or the file is not tracked, no ``<lastmod>`` element will be added for that page.
168
+
169
+
.. tip:: The ``<lastmod>`` timestamps are particularly useful for :ref:`RAG (Retrieval-Augmented Generation) systems <rag-ingestion>` that need to identify recently updated content for incremental updates.
0 commit comments