-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Allow loading cover from /assets folder #1187
Allow loading cover from /assets folder #1187
Conversation
By default, the cover is loaded from the page resources folder (same folder). If the image is not found, the (global) assets folder is searched as well. If found, the same processing is done. Otherwise, the fallback remains with linking to the image directly.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
@timonback Thanks! This was really missing.
By default, the cover is loaded from the page resources folder (same folder). If the image is not found, the (global) assets folder is searched as well. If found, the same processing is done. Otherwise, the fallback remains with linking to the image directly.
@timonback Appreciate the contrib. Wondering why I am getting this error while compiling with
I reverted your commit on my local copy of the repository and stuff seems to work. Any idea what could be the cause ? Thanks and Regards |
Hi @git-clone-abhinav, I had no issues when testing locally, although with a newer version as mentioned above. Not sure if it is feasible to update Hugo - just for verification? |
Updated Hugo to Hugo Latest Release v0.111.3. The problem seem to revolve around older Hugo version. The commit works like butter now. Note : Thanks and Regards |
Thank you for identifying this. @timonback @git-clone-abhinav Can we find out the minimum hugo version required for this patch to work well? |
Okay, so I tested with some Hugo versions, however I skipped some too in order to make the process faster. The minimum required Hugo Version is The table below provides more details of the tests in the order they were performed. Binaries that I used were downloaded in the following name pattern :
My Local Machine : uname -r
cat /etc/os-release | head -n7
@adityatelange Thanks for this amazing theme. Regards |
Thank you @git-clone-abhinav for the test :) |
required for adityatelange#1187
By default, the cover is loaded from the page resources folder (same folder). If the image is not found, the (global) assets folder is searched as well. If found, the same processing is done. Otherwise, the fallback remains with linking to the image directly.
required for adityatelange#1187
What does this PR change? What problem does it solve?
My initial issue is that I store all cover images in the
/assets
folder, separate from my posts (to be precise, I even store them via git submodules in a different git repo). I still want to benefit from the Hugo Pipes image processing to render different image sizes.Behaviour after the change:
By default, the cover is loaded from the page resources folder (same folder). If the image is not found, the (global)
/assets
folder is searched as well. If found, the same processing is done. Otherwise, the fallback remains with linking to the image directly.Tested with hugo v0.111.3+extended
Hugo Pipes Docs (incl.
/assets
folder): https://gohugo.io/hugo-pipes/introduction/#asset-directoryPR Checklist