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

Make ge, le etc. work with the Hugo Version number #4443

Closed
regisphilibert opened this issue Feb 21, 2018 · 5 comments
Closed

Make ge, le etc. work with the Hugo Version number #4443

regisphilibert opened this issue Feb 21, 2018 · 5 comments

Comments

@regisphilibert
Copy link
Member

regisphilibert commented Feb 21, 2018

These days, we rely a lot on Netlify, Forestry which may or may not impose their own version of Hugo.

Plus not every Theme user may be using the last version of Hugo. Even though Themes must indicate a minversion, it would be interesting to be able to add new features like Page Bundle management, while still catering for users using older version of Hugo.

While it is hard to test if a feature is available for a current version, we need to test which version the project is using before calling .Resources or other.

The .Hugo.Version variable being a semver string it is not currently testable with common template func like ge or le

@bep bep changed the title Add template function to test Hugo Version Make ge, le etc. work with the Hugo Version number Feb 21, 2018
@bep
Copy link
Member

bep commented Feb 21, 2018

The problem with any new functionality in this department is that you will have to wait until it's available.

@regisphilibert
Copy link
Member Author

The problem with any new functionality in this department is that you will have to wait until it's available.

Not sure to follow.

@bep
Copy link
Member

bep commented Feb 21, 2018

My proposed fix is that you should be able do do:

if ge .Hugo.Version "0.35" 

But that will not work in Hugo 0.17 (default on Netlify).

@regisphilibert
Copy link
Member Author

Yes of course, at least we'll have it post .37 or whenever you'll find time for this.

I don't think there is a better way to approach the issue though :/

@github-actions
Copy link

github-actions bot commented Mar 7, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants