website/layouts/case-studies/list.html

58 lines
2.2 KiB
HTML
Raw Normal View History

{{ define "main" }}
{{ $featured := where .Pages "Params.featured" true }}
<section id="mainContent">
<main>
<div class="content">
<div class="case-studies">
{{ range $featured }}
{{ template "case-study-featured-block" . }}
{{ end }}
</div>
</div>
</main>
</section>
{{ $featuredVideos := where .Pages ".Params.video" "!=" nil }}
{{ with $featuredVideos }}
{{ with index $featuredVideos 0 }}
<section id="video">
<main>
<div>
<h4><i>"{{ .Params.quote | html }}"</i></h4>
{{ $img := .Resources.GetMatch "video.png" }}
{{ $small := .Resources.GetMatch "**small*.png" }}
{{ with $small }}<img src="{{ .RelPermalink }}" alt="{{ .Title }}">{{ end }}
</div>
<div style= "padding-left: 40px;"><button onclick="kub.showVideo()">{{ with $img }}<img src="{{ .RelPermalink }}" alt="Box video">{{ end }}<h6>Kubernetes at Box</h6></button></div>
</main>
<div id="videoPlayer">
<iframe data-url="{{ .Params.video | safeURL }}" frameborder="0" allowfullscreen="true"></iframe>
<button id="closeButton"></button>
</div>
</section>
{{ end }}
{{ end }}
<section id="users">
<main>
<h3>Kubernetes Users</h3>
<div id="usersGrid">
{{ range .Pages.ByTitle }}
{{ $logo := .Resources.GetMatch "**logo*.png" }}
{{ $p := . }}
<a target="_blank" href="{{ with $p.Params.content_url }}{{ . | safeURL }}{{ else }}{{ .RelPermalink }}{{ end }}">{{ with $logo }}<img src="{{ .RelPermalink }}" alt="{{ $p.LinkTitle }}">{{ else }}
{{ errorf "Case Studies: Missing logo for %s. Put a PNG with the word 'logo' in the filename into %q" $p.LinkTitle $p.Dir }}
{{ end }}</a>
{{ end }}
<a target="_blank" href="https://docs.google.com/a/google.com/forms/d/e/1FAIpQLScuI7Ye3VQHQTwBASrgkjQDSS5TP0g3AXfFhwSM9YpHgxRKFA/viewform" class="tell-your-story"><img src="/images/case_studies/story.png" alt="Tell your story"></a>
</div>
</main>
</section>
{{ .Content }}
{{ end }}
{{ define "case-study-featured-block" }}
{{ $logo := .Resources.GetMatch "**{feature,logo}*.png" }}
<div class="case-study">
{{ with $logo }}<img src="{{ .RelPermalink }}" alt="{{ .Title }}">{{ end }}
<p class="quote">"{{ .Params.quote | html }}"</p>
<a href="{{ .RelPermalink }}">Read about {{ .LinkTitle }}</a>
</div>
{{ end }}