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 · 4 comments

Comments

Projects
None yet
2 participants
@regisphilibert

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 from Add template function to test Hugo Version to Make ge, le etc. work with the Hugo Version number Feb 21, 2018

@bep bep added the Enhancement label Feb 21, 2018

@bep

This comment has been minimized.

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

This comment has been minimized.

regisphilibert commented Feb 21, 2018

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

This comment has been minimized.

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

This comment has been minimized.

regisphilibert commented Feb 21, 2018

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 :/

@bep bep added this to the v0.37 milestone Feb 21, 2018

@bep bep closed this in 0602135 Feb 22, 2018

bep added a commit that referenced this issue Feb 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment