diff --git a/README.md b/README.md index 3b4d3d7..e422327 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,7 @@ For example, CDN links for the packages `"@fortawesome/fontawesome-free"` and `" ### 7. Last Updated The special `file` varaible can be leveraged to create a "Last Updated" field that is -automatically populated with the date the HTML was most recenlty modified. +automatically populated with the date the source file was most recently modified. For example, an HTML file with following lines: ```html @@ -207,7 +207,6 @@ For example, an HTML file with following lines: ``` - will be transformed into something similar to: ```html
@@ -216,6 +215,20 @@ will be transformed into something similar to:
``` +**Note:** +Be aware that `git checkout` deliberately resets file modification dates (`mtime`).  +If you use GitHub Actions to publish your website, you'll need to restore file modification dates with a script or tool. +One tool that does this is [chetan/git-restore-mtime-action](https://github.com/marketplace/actions/git-restore-mtime): +```yaml + steps: + - uses: actions/checkout@v4 + with: + ref: main #fetch the full git history of the "main" + fetch-depth: 0 #branch for git-restore-mtime-action + - uses: chetan/git-restore-mtime-action@v2 + - uses: actions/setup-node@v4 +``` +For a working example, see: [publish-website.yaml](https://github.com/center-key/think-metric/blob/main/.github/workflows/publish-website.yaml) ## C) Application Code Even though **replacer-util** is primarily intended for build scripts, the package can be used programmatically in ESM and TypeScript projects. diff --git a/package.json b/package.json index 39bb985..9ab0aa4 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "@eslint/js": "~9.9", "@fortawesome/fontawesome-free": "~6.6", "@types/fancy-log": "~2.0", - "@types/node": "~22.2", + "@types/node": "~22.3", "add-dist-header": "~1.4", "assert-deep-strict-equal": "~1.2", "copy-file-util": "~1.2",