diff --git a/_components/Feedback.tsx b/_components/Feedback.tsx index 9f682a9d0..0c215b9d8 100644 --- a/_components/Feedback.tsx +++ b/_components/Feedback.tsx @@ -3,6 +3,25 @@ export default function Feedback({ file }) { return <>; } else { const githubPath = "https://github.com/denoland/docs/edit/main" + file; + + let modifiedDate = null; + try { + const dateString = new TextDecoder().decode( + (new Deno.Command("git", { + args: [ + "log", + "-1", + "--pretty=%cI", + "./" + file, + ], + })).outputSync().stdout, + ); + + modifiedDate = new Date(dateString); + } catch (e) { + console.log(e); + } + return (
+ {modifiedDate && + ( +
+ This page was last modified on{" "} + . +
+ )} +