dotnet / dotnet/docfx

[Feature Request] Update sitemap's lastmod datatime when data modified only.

Open
#8,820 0 comments 0 reactions 0 assignees View on GitHub
static-site
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

**Is your feature request related to a problem? Please describe.**

`sitemap.xml` contains `lastmod` datetime information.
Current docfx implementation update this value every time when `docfx build` executed.

It seems there is roadmap to support `lastmod` updated when data modified, but currently this comment is removed.
https://github.com/dotnet/docfx/commit/3fed33dd08b6a637804b7ac376bfd85c7dccb126#diff-9e7357a546022bca50c8ec6d9681852067e98a79c287ebf5e88dfcc97a760df4L19

**Describe the solution you'd like**

This datetime should be changed if there are major changes in content
So I thought datetime should be retrieved by following priority.

1. Metadata specified on document (like `ms.date`) if defined.
-> Currently there is scandalized metadata name is not defined.
-> Microsoft Learn define these metadata (https://learn.microsoft.com/en-us/contribute/metadata)
2. Git last commit/modified date. (like [DocFx.Plugin.LastModified](https://github.com/Still34/DocFx.Plugin.LastModified/blob/master/DocFx.Plugin.LastModified))
3. (Fallback) Last modified datetime on local file system or current build datetime.
-> It may need to suppress overwrite file if content is not changed?

**Expected `lastmod` datatime usage**

sitemap's `lastmod` data itself is not so useful for my usage. (At least it works if every time modified).
thought If docfx's standardized `last modified datetime` is defined.
It can implement PostProcessor to generate RSS/Atom feed. (If standardized document updated date is available)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.