fix: set the cover page date to pdf build date#9
Open
foodelevator wants to merge 1 commit intomasterfrom
Open
Conversation
Member
|
If you want to force Typst to follow a specific date, just setting See typst/typst#5282 |
Member
Author
|
Ah, so something like |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not sure exactly what is best to set the date to, but went with current date when building (which happens when pushing/merging to master and that's what's uploaded to the link we have posted in Discord).
My first idea was to get the date of the latest commit, but that requires traversing
.git/HEAD->.git/refs/heads/$branch_name->.git/objects/${commit_id::2}/${commit_id:2}, then zlib-decompressing that, extracting the date on a line likecommitter $name <$email> $date $tz_offsetthen interpreting a unix timestamp. Or of course usinggit log -1 --format=%cd, but you can't run external commands from typst so that would need to be put in a file before compiling so we would need to add a build script. But maybe that would be fine/better?Also, you can't get Swedish month names i typst by default, so I had to insert them manually.