Repository navigation
feat: post cover as a full-width banner - #8
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The post cover becomes a full-width banner, right under the top bar and above the title.
layout.htmlhas a new emptybannerblock between the top bar and<main>;post.htmlfills it with the cover. The banner sits outside the 44rem text column, so it spans the page with no100vwtricks and no horizontal scroll.height: min(30vh, 320px),min(25vh, 200px)up to 30rem;object-fit: cover, centered; no rounded corners;--surfacebackground while loading.width/heightattributes are kept. Because the CSS height is fixed, the box size never depends on the image.<main>, and a post without a cover has no banner.cover.Checked with screenshots of a 1600×900 test cover at 1280×900, 1920×1080 and 390×844, light and dark, plus a post without a cover. Heights were 270, 320 and 200 px; the crop was centered;
scrollWidthmatched the viewport. vet, staticcheck, govulncheck andgo test -racepass.