Closed Agos95 closed 1 year ago
I'm unsure if I understand what the problem is. If the image is now displayed twice in the Course Starter Template, why not just remove the second image (the {{<figure>}}
) from the template's Markdown file?
In Book layout, the cover image is fitted to 1800x310 px
so it is cropped and resized.
So, I suggest one of the following:
preview_only
, as for page cover imagesAlign the code for the Book cover image https://github.com/wowchemy/wowchemy-hugo-themes/blob/2d67669ce7694d4b2f632994660ca7aeff27f0db/modules/wowchemy/layouts/partials/book_layout.html#L35-L46
to the one of Pages cover/banner images https://github.com/wowchemy/wowchemy-hugo-themes/blob/2d67669ce7694d4b2f632994660ca7aeff27f0db/modules/wowchemy/layouts/partials/page_header.html#L18-L60
This issue is stale because it has not had any recent activity. The resources of the project maintainers are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the main
branch, consider contributing a Pull Request with a fix.
If this is a feature request, and you feel that it is still relevant and valuable, consider contributing a Pull Request for review.
This issue will automatically close soon if no further activity occurs. Thank you for your contributions.
Preliminary Checks
Description
In Wowchemy v5.7.0 we introduced the
get_featured_image
funtion to retrieve the feature image in a more flexible way.However, this causes some problems in hte Book layout, such as in the Online Course Template. In fact, if we update to the latest Wowchemy version (
main
branch), we get:This is due to the fact that
get_featured_image
finds the attachmentfeatured.jpg
in the folder, and automatically sets it as a cover image (change introduced in 18ac0b4). Instead, the logic behind the template is to include the image using{{<figure>}}
shortcode, and usefeatured.jpg
just for the course page.If we rename
featured.jpg
to something else, we loose the image in the course page.Proposed Solution
I am already working on a PR to fix this issue. My idea is to include in the Front Matter of a book page something like
(with
true
as default), and to include the cover image only if this parameter istrue
.Reproduction Link
https://github.com/Agos95/wowchemy-hugo-themes/tree/update-starters/starters/course
Steps to Reproduce
go.mod
to the latest version (main
branch)Expected Result
Cover image should not appear
Actual Result
Cover image appears automatically since
get_featured_image
finds the attachmentfeatured.jpg
in the folderWhat Hugo Module versions does your site use?
module github.com/wowchemy/starter-hugo-online-course
go 1.15
require ( github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify v1.0.0 // indirect github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify-cms v1.0.0 // indirect github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy/v5 v5.7.1-0.20230501161443-2d67669ce769 // indirect )
What operating system(s) are you seeing the problem on?
Linux
What browser(s) are you seeing the problem on?
Firefox
Which Wowchemy template are you using?
Online Course
What version of Hugo are you using?
Hugo extended 0.111.3