Skip to content
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 tool-versions file #1559

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ThisIsMissEm
Copy link
Contributor

This helps software like asdf discover exactly what version of hugo to use, since hugo versions often have incompatibilities.

I've been bitten many times working on docs but having the wrong version of hugo in my $PATH

This helps software like asdf discover exactly what version of hugo to use, since hugo versions often have incompatibilities
@ThisIsMissEm
Copy link
Contributor Author

Added comments to try to keep this in sync, since we can't reuse the tool-versions file in GitHub Actions directly

Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with asdf so I'm not sure if that is something we want to support/encourage, but if we do, this PR looks good to me.

@ThisIsMissEm
Copy link
Contributor Author

@ClearlyClaire the main reason I ended up using asdf for Hugo was because I contribute to multiple Hugo sites each running different incompatible versions, so I'd constantly get weird breakages when switching between repos. asdf helps with that by automatically switching my hugo version to the right one for the project & the .tool-versions file in the root of the repo acts as a bit of a guide as to what we use.

@mjankowski
Copy link
Contributor

FYI, you can do something like...

echo ".tool-versions" >> .git/info/exclude

...which will let you get the benefits of asdf locally, w/out needing the project to adopt it or add to their gitignore.

@ThisIsMissEm
Copy link
Contributor Author

I'd be of the inclination to suggest we do adopt .tool-versions here, not necessarily to say adopt asdf, but rather to have a file in the root of the repository that does contain the version required.

@mjankowski
Copy link
Contributor

Yes, agreed on having it better locked/specified somewhere.

Im guessing theres no equivalent of .nvmrc or .ruby-version for hugo projects? Also, its too bad the format here with extended doesnt quite match the format needed in the CI config...

@ThisIsMissEm
Copy link
Contributor Author

ThisIsMissEm commented Nov 26, 2024

Also, its too bad the format here with extended doesnt quite match the format needed in the CI config...

Yeah, that annoys me too, but there isn't really anything we can do about that, unless we do an upstream PR to the github action to support .tool-versions syntax?

@mjankowski
Copy link
Contributor

Sort of related - https://github.com/peaceiris/actions-hugo?tab=readme-ov-file#%EF%B8%8F-read-hugo-version-from-file - the GH action that publishes the site could pull that version value from a file (example there is a .env, but in theory could do whatever)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants