docs icon indicating copy to clipboard operation
docs copied to clipboard

Replace the `git-restore-mtime` based "last updated at" system with something that scales better

Open epbarger opened this issue 4 years ago • 0 comments

To determine the "last updated at time" for each page, we currently...

  1. Have the whole repo history downloaded (IE not a shallow clone)
  2. Run git-restore-mtime to fix the mtime attributes on all the files
  3. Pull in the file's mtime through the gatsby graph

This works fine, but doesn't scale super well. Because we need a full clone of the repo to determine the time the file was last modified at, the build process can't use a shallow clone.

We could replace this system with a git hook that writes the modified time into the mdx file's frontmatter at commit time. This would allow the build process to take a shallow clone, since this mtime information would be encoded into each file. Then the modified time can be pulled from frontmatter instead of the file attributes.

epbarger avatar Mar 29 '21 17:03 epbarger