shift-org / shift-docs

Website + calendar for the shift organization
https://shift2bikes.org
Other
22 stars 14 forks source link

add "forceCurrentTime" option for dayjs #742

Open ionous opened 2 weeks ago

ionous commented 2 weeks ago

this allows a developer to override the current date and time on the front end for testing. in site config.toml set "forceCurrentTime" to something useful. for example:

[params]
forceCurrentTime =  "06-13-2024 23:00"

as a safety, it only works when building drafts. preview deploys use drafts, but production does not. re: https://github.com/shift-org/shift-docs/blob/main/netlify.toml

[context.deploy-preview]
  # this command builds draft content for deploy previews
  command = 'hugo -D && cp public/404/index.html public/404.html'

[context.production]
  # Note that there are two versions of the below command 
  # drafts are excluded (no `-D` option to hugo) for prod build. 
  command = 'hugo ...