1
Fork 0

Fix main images on content

This commit is contained in:
Jake Howard 2017-05-09 21:04:08 +01:00
parent d6653aeeec
commit 02c50ec543
6 changed files with 33 additions and 15 deletions

View file

@ -2,7 +2,7 @@
title: Student Robotics title: Student Robotics
linktitle: Robotics linktitle: Robotics
image: https://farm4.staticflickr.com/3849/33683313131_6ba584094a_k_d.jpg 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. 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.

View file

@ -7,21 +7,23 @@
{{ if .Content }} {{ if .Content }}
<div class="box"> <div class="box">
{{ if .Params.image }} {{ 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 }} {{ end }}
{{ .Content }} {{ .Content }}
</div> </div>
{{ end }} {{ end }}
<div class="row"> {{ if ne .Params.hide_pages "true" }}
{{ $parent := . }} <div class="row">
{{ range where .Pages.ByTitle "Params.show_in_nav" "!=" "false" }} {{ $parent := . }}
{{ if $parent.Params.show_images }} {{ range where .Pages.ByTitle "Params.show_in_nav" "!=" "false" }}
{{ partial "box_image.html" . }} {{ if $parent.Params.show_images }}
{{ else }} {{ partial "box_image.html" . }}
{{ partial "box.html" . }} {{ else }}
{{ partial "box.html" . }}
{{ end }}
{{ end }} {{ end }}
{{ end }} </div>
</div> {{ end }}
</section> </section>
</div> </div>
{{ partial "page_end.html" . }} {{ partial "page_end.html" . }}

View file

@ -9,7 +9,7 @@
</header> </header>
<div class="box"> <div class="box">
{{ if .Params.image }} {{ 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 }} {{ end }}
{{ .Content }} {{ .Content }}
</div> </div>

View file

@ -9,7 +9,7 @@
</header> </header>
<div class="box"> <div class="box">
{{ if .Params.image }} {{ 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 }} {{ end }}
{{ .Content }} {{ .Content }}
</div> </div>

View file

@ -7,3 +7,13 @@ require('bootstrap');
require('./alpha/jquery.dropotron.min'); require('./alpha/jquery.dropotron.min');
require('./alpha/util'); require('./alpha/util');
require('./alpha/main'); 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');
}
});

View file

@ -32,6 +32,12 @@ pre code {
padding: 0; padding: 0;
} }
.image.featured { .image {
max-height: 45vh; background-repeat: no-repeat;
background-position: center;
background-size: cover;
&.featured.main {
height: 40vh;
}
} }