-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Resize preview image in posts? #84
Comments
Thanks, changing the
It would be nice to just have a variable in the header of each post specifying the width of the image. Is this possible? |
The Theme Color (CSS) section at https://gcushen.github.io/hugo-academic-demo/post/getting-started/ explains how to override the CSS style without directly editing Academic's files. It should be possible to override the CSS in a similar way to Chas mentioned, except editing it so that images appear in their exact size, for example. Then you can control the image dimensions for each post as they can be set to the uploaded image size. |
Thanks for the hints guys. I got it working. First, create a personal img,
video {
height: auto;
max-width: 100%;
display: block;
} to video {
height: auto;
max-width: 500px;
margin-left: auto;
margin-right: auto;
display: block;
} This results in a nicely sized and centered post header image |
I find I have to modify the css at |
FYI that method is not best practice. Custom styles are documented here: https://sourcethemes.com/academic/docs/customization/#customize-style-css |
Thank you @pat-s for the awesome answer! Saved me a ton of time :) |
Example: "Getting Started" banner in https://gcushen.github.io/hugo-academic-demo/post/getting-started/
Is there a way to resize and center such images? Or are they fixed to full width when specified in the header of a post?
I tried to resize it manually. However, images are always stretched to full page/post width..
The text was updated successfully, but these errors were encountered: