Feature Request: A change history embedded in each dist index.html page (Sample code in link) #1040
Replies: 2 comments 1 reply
-
I believe your request is about the build script (as the dev script does not modify files in dist/). Even if nothing changes it might be important for a reader to know that the site has been built recently—that they are not looking at a stale page. If you don't want the page to show the date in the footer, you could specify a different footer option (see config#footer). (Also please don't share code generated by ChatGPT as it just muddies the discussion.) |
Beta Was this translation helpful? Give feedback.
-
To reiterate @Fil’s answer, you just need to set the footer config option to not show the current date in the footer. For example: export default {
footer: `Built with <a href="https://observablehq.com/" target="_blank">Observable</a>.`
}; If you want the date in the footer, but you only want to update it when the data or the code has changed, that’s a harder problem. I guess you’d need to look at the modification times of the Markdown page, or its transitive sources, or perhaps you’d need to keep the last build around in a cache and check if the contents of the data have changed. I’m sure someone could figure out if they really wanted, but I think as a default it’s best to show the most recent time the page was built, even if the contents haven’t changed. |
Beta Was this translation helpful? Give feedback.
-
By default, when
yarn dev
ornpm run dev
are run, only update the date and time in the index.html "dist" files when an index.html file has changed. Changing the Update date in the footer when the content has not changed causes a lot of unnecessary file storage in GitHub. Also provide the option to store a Change History in each index.html page, and display when clicking a "Changed" link that reside before the most recent change date. Also provide the option to display a "Built" date - and what the heck, a Built History option while we're at it.ChatGPT code sample removed per Fil's request. Thanks for the footer info Fil!
New code for Change History is described and linked to at the bottom.
(Currently just Change History, needs revision to include Built History too.)
Also here's the output (see anything to tweak?):
https://chat.openai.com/share/cef80ef6-7248-4a30-a93e-780482bd6e50
Beta Was this translation helpful? Give feedback.
All reactions