Fix main images on content
This commit is contained in:
parent
d6653aeeec
commit
02c50ec543
6 changed files with 33 additions and 15 deletions
|
@ -2,7 +2,7 @@
|
|||
title: Student Robotics
|
||||
linktitle: Robotics
|
||||
image: https://farm4.staticflickr.com/3849/33683313131_6ba584094a_k_d.jpg
|
||||
show_images: true
|
||||
hide_pages: false
|
||||
---
|
||||
|
||||
Student Robotics is the the place where my development knowledge really started to grow. Thanks to the other people in my team teaching me. I had never done anything robotics related, and so when my computing teacher initially told us about it, I wasn't really interested. After I found out that my friend was also doing it, I signed up, and went along to the kickstart. From then on I was hooked, getting involved with all aspects of the development and design, as well as helping out other teams on the IRC room.
|
||||
|
|
|
@ -7,21 +7,23 @@
|
|||
{{ if .Content }}
|
||||
<div class="box">
|
||||
{{ if .Params.image }}
|
||||
<span class="image featured"><img src="{{ .Params.image }}" alt="{{ .Title }} image" /></span>
|
||||
<span class="image featured main" data-image="{{ .Params.image }}"></span>
|
||||
{{ end }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="row">
|
||||
{{ $parent := . }}
|
||||
{{ range where .Pages.ByTitle "Params.show_in_nav" "!=" "false" }}
|
||||
{{ if $parent.Params.show_images }}
|
||||
{{ partial "box_image.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "box.html" . }}
|
||||
{{ if ne .Params.hide_pages "true" }}
|
||||
<div class="row">
|
||||
{{ $parent := . }}
|
||||
{{ range where .Pages.ByTitle "Params.show_in_nav" "!=" "false" }}
|
||||
{{ if $parent.Params.show_images }}
|
||||
{{ partial "box_image.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "box.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</section>
|
||||
</div>
|
||||
{{ partial "page_end.html" . }}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</header>
|
||||
<div class="box">
|
||||
{{ if .Params.image }}
|
||||
<span class="image featured"><img src="{{ .Params.image }}" alt="{{ .Title }} image" /></span>
|
||||
<span class="image featured main" data-image="{{ .Params.image }}"></span>
|
||||
{{ end }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</header>
|
||||
<div class="box">
|
||||
{{ if .Params.image }}
|
||||
<span class="image featured"><img src="{{ .Params.image }}" alt="{{ .Title }} image" /></span>
|
||||
<span class="image featured main" data-image="{{ .Params.image }}"></span>
|
||||
{{ end }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
|
|
@ -7,3 +7,13 @@ require('bootstrap');
|
|||
require('./alpha/jquery.dropotron.min');
|
||||
require('./alpha/util');
|
||||
require('./alpha/main');
|
||||
|
||||
|
||||
$('.image').each(function () { // setup div-image hybrids
|
||||
var ele = $(this);
|
||||
if (ele.data('image')) {
|
||||
ele.css('background-image', 'url(' + ele.data('image') + ')');
|
||||
} else {
|
||||
ele.removeClass('image');
|
||||
}
|
||||
});
|
||||
|
|
|
@ -32,6 +32,12 @@ pre code {
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
.image.featured {
|
||||
max-height: 45vh;
|
||||
.image {
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
|
||||
&.featured.main {
|
||||
height: 40vh;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue