Skip to content

Markdown metadata for date field is all in 1970 #507

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

Open
stefmolin opened this issue May 20, 2025 · 3 comments
Open

Markdown metadata for date field is all in 1970 #507

stefmolin opened this issue May 20, 2025 · 3 comments

Comments

@stefmolin
Copy link
Contributor

I just noticed that the date field in the metadata for several Markdown files (for example tutorials/publish-conda-forge.md) states they were written in 1970. It looks like these were introduced in #488.

@stefmolin
Copy link
Contributor Author

For my website, I use a tool in my GitHub Actions workflow to restore the modified time to my post Markdown files so that the RSS feed always has the true last modified time:

- name: Checkout
  uses: actions/checkout@v4
  with:
    fetch-depth: 0  # need to fetch all commits for git restore-mtime

- name: Restore timestamps
  run: sudo apt-get install git-restore-mtime && git restore-mtime

Then, you can remove this field from the metadata of each file, and in Python, you can do Path(file).stat().st_mtime to grab the timestamp for your RSS feed (see https://docs.python.org/3/library/pathlib.html#pathlib.Path.stat).

@ucodery
Copy link
Collaborator

ucodery commented May 20, 2025

Pinging @sneakers-the-rat. This is odd, but it looks like the frontmatter you added got some generated dates? It looks to me like it was something akin to date.fromtimestamp(0) + file_enumeration_index. I don't see anything like that in your PR, but it might have been a script you used before commit?

@sneakers-the-rat
Copy link
Contributor

sneakers-the-rat commented May 20, 2025

Lol no those were just placeholder dates intended to be replaced with actual dates

I dont think I changed the mtime, but this would probably do it: https://github.com/pyOpenSci/python-package-guide/pull/488/files#diff-77763db26eb3ad9b3f8b8b9104c9ec0b97bbc5d264f644f811803ca1381616a1R4

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

No branches or pull requests

3 participants