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 control over header image #731

Merged
merged 4 commits into from
Oct 21, 2024
Merged

Conversation

miaucl
Copy link
Contributor

@miaucl miaucl commented Oct 12, 2024

Please provide enough information so that others can review your pull request:

Currently, the header image for a post is bg-top, but it would be nice the control this behavior to lets say top|center|bottom, as often the interesting part of an image is in the center. Using the featured_image_class param, one can now customize the class to control the alignment of the featured header image. It is also possible to add additional classes for further customization if needed.

Explain the details for making this change. What existing problem does the pull request solve?

Test plan (required)

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Default case:

Bildschirmfoto 2024-10-12 um 14 23 10

Same as default case but set explicitly featured_image_class = cover bg-top:

Bildschirmfoto 2024-10-12 um 14 23 10

featured_image_class = cover bg-center:

Bildschirmfoto 2024-10-12 um 14 23 27

featured_image_class = cover bg-bottom:

Bildschirmfoto 2024-10-12 um 14 23 36

featured_image_class = contain bg-top:

Bildschirmfoto 2024-10-12 um 14 29 16

Code formatting

Closing issues

Closes #729

- Add the param to the example with an explanation
- It can also be used to add more classes for futher customization if needed
- cover remains the default, but with breakpoints one gains flexibility an can add rules for different devices
Copy link

netlify bot commented Oct 12, 2024

Deploy Preview for gohugo-ananke-theme-demo failed. Why did it fail? →

Name Link
🔨 Latest commit 91a895f
🔍 Latest deploy log https://app.netlify.com/sites/gohugo-ananke-theme-demo/deploys/670a72f80aaa8900080829f9

@miaucl
Copy link
Contributor Author

miaucl commented Oct 12, 2024

Not sure why the build fails, it complains about something unrelated to my changes imo.

@davidsneighbour
Copy link
Collaborator

If you force-push the current state, the Netlify jobs should run without issue.

Copy link
Collaborator

@davidsneighbour davidsneighbour left a comment

Choose a reason for hiding this comment

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

👍

@davidsneighbour davidsneighbour merged commit 9fc4b73 into theNewDynamic:main Oct 21, 2024
0 of 4 checks passed
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.

2 participants