diff --git a/assets/sass/academic/_content.scss b/assets/sass/academic/_content.scss index 5a2dc7ae..040b3303 100644 --- a/assets/sass/academic/_content.scss +++ b/assets/sass/academic/_content.scss @@ -13,14 +13,6 @@ article { margin: 0 auto 0 auto; } -.split-header { - margin-bottom: 2rem; -} - -.split-header .share-box { - float: left; -} - .page-subtitle { font-size: 1.15rem; color: rgba(0,0,0,.54); @@ -31,25 +23,6 @@ article { color: rgba(255,255,255,0.54); } -.split-header .page-subtitle { - margin-bottom: 1.5rem; -} - -.split-header-content { - max-width: 612px; - width: 100%; - padding: 60px 60px 32px 0; - margin-left: auto; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -.split-header-image { - position: relative; /* Required for caption positioning */ - clear: both; - max-width: 580px; -} - .article-header { position: relative; /* Required for caption positioning */ clear: both; @@ -60,30 +33,17 @@ article { height: auto; } +.featured-image-wrapper { + position: relative; + padding-left: 0; /* Override container padding. */ + padding-right: 0; /* Override container padding. */ +} + .featured-image { + position: relative; width: 100%; - background-position: left; - background-origin: border-box; - background-size: cover; - height: 60vh; - min-height: 500px; - -webkit-box-flex: 1; - -webkit-flex: 1 0 auto; - -ms-flex: 1 0 auto; - flex: 1 0 auto -} - -@media screen and (max-width: 1199px) { - .featured-image { - min-height: 400px; - height: auto; - } -} - -@media screen and (max-width: 767px) { - .featured-image { - min-height: 300px; - } + display: block; + margin: 0 auto; } .article-header-caption { diff --git a/exampleSite/content/post/getting-started/index.md b/exampleSite/content/post/getting-started/index.md index 8e89c8e0..5581292f 100644 --- a/exampleSite/content/post/getting-started/index.md +++ b/exampleSite/content/post/getting-started/index.md @@ -14,8 +14,10 @@ draft: false # Featured image # To use, add an image named `featured.jpg/png` to your page's folder. +# Placement options: 1 = Full column width, 2 = Out-set, 3 = Screen-width # Focal point options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight image: + placement: 1 caption: 'Image credit: [**Unsplash**](https://unsplash.com/photos/CpkOjOcXdUY)' focal_point: "" preview_only: false @@ -71,7 +73,7 @@ gallery_item: - [Decorate your laptop or journal with an Academic sticker](https://www.redbubble.com/people/neutreno/works/34387919-academic) - [Wear the T-shirt](https://academic.threadless.com/) -[](https://github.com/gcushen/hugo-academic/) +{{< figure src="https://raw.githubusercontent.com/gcushen/hugo-academic/master/academic.png" lightbox="true" >}} **Key features:** diff --git a/layouts/partials/page_header.html b/layouts/partials/page_header.html index 1101149e..fbb5671b 100644 --- a/layouts/partials/page_header.html +++ b/layouts/partials/page_header.html @@ -28,42 +28,31 @@ {{end}} -{{/* Featured image */}} +{{/* Featured image layout */}} {{ if and $featured (not .Params.image.preview_only) }} -{{ $image := $featured.Resize "800x" }} -
{{ . | markdownify | emojify }}
- {{end}} +{{/* Determine image placement. */}} +{{ $placement := .Params.image.placement | default 1 }}{{/* Default to full column width. */}} +{{ $image_container := "" }} +{{ if eq $placement 2}} + {{ $image_container = "container" }} + {{ if gt $featured.Width 1200 }} + {{ $image = $featured.Resize "1200x" }} + {{ end }} +{{else if eq $placement 3}} + {{ $image_container = "container-fluid" }} + {{ $image := $featured.Fit "2560x2560" }} +{{else}} + {{ $image_container = "article-container" }} + {{ if gt $featured.Width 720 }} + {{ $image = $featured.Resize "720x" }} + {{ end }} +{{end}} - {{ partial "page_metadata" (dict "page" $page "is_list" 0) }} - - {{ partial "page_links_div.html" $page }} - - {{ partial "share.html" $page }} -