-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add release version number to navbar #1083
Closed
Closed
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e7927af
Add release version number to navbar
jasonviviano 99188fb
Testing changes to release-docs for version displayed in navbar
jasonviviano bf12cf3
Created a section that strictly replaces `version=latest`
jasonviviano 1090459
Fixed a line that shouldnt be changed/
jasonviviano f922167
Merge branch 'v0.31' into jasonviviano/release-number
jasonviviano 635415a
Made changes to release-docs.sh conditions
jasonviviano 314687a
Update .github/scripts/release-docs.sh
jasonviviano 2636678
Merge branch 'v0.31' into jasonviviano/release-number
jasonviviano 5dfad6d
Addressed feedback
jasonviviano 181ee8d
Added config file.
jasonviviano f44c3f3
Fixed indentation
jasonviviano cf36ee1
Update docs/config.toml
jasonviviano 7568729
Update docs/config.toml
jasonviviano 02b2efc
Fixed indentation changes that awk made with new command sed
jasonviviano 190e4a6
Added a command for cleanup
jasonviviano 6df1436
Apply suggestions from code review
jasonviviano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When testing this it looks like the indentation is off:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but the indentation is a stylistic choice here it doesn't affect the outcome, if you run the
hugo server
command the indentation has no effect on the variable value as it's just a text file. And looking at alternatives I can add an indentation to theawk
command but that will end up indentation the otherversion
variable above. So, it's just a stylistic choice.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the toml schema for more details: https://github.com/toml-lang/toml?tab=readme-ov-file#example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey i fixed it by changing the command!
Here's an explanation of the new one:
In this sed command:
-i.bak edits the file in place and creates a backup with the .bak extension.
-E enables extended regular expressions, which allow for more complex patterns.
The pattern ^( *)[ \t]version = "(latest|v.)" is used to match lines with version = "latest" or version = "v..."
^( )[ \t] captures leading spaces (or tabs) before version = and stores them in \1.
\1 in the replacement part puts the captured indentation back, ensuring the replacement line has the same leading whitespace as the original.
${DOC_VERSION_STRING_REPLACEMENT} is inserted after the captured whitespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a line after this to delete the tmp file created to pick up the whitespaces