hugo-theme-introduction/layouts/partials/projects.html

76 lines
2.7 KiB
HTML
Raw Normal View History

2017-11-13 21:01:53 +00:00
<div class="container">
<!-- Begin Projects container -->
<h2 class="title is-2 has-text-centered">Projects</h2>
2017-03-13 09:14:02 +00:00
2017-11-13 21:01:53 +00:00
<div class="section is-small">
<div class="columns is-multiline">
{{ range sort .Pages }} {{ if eq .Section "projects" }}
<div class="column is-one-third">
<!-- Hey Vicky, show half column if number is even. -->
<div class="card">
<div class="card-image">
<figure class="image is-3by2">
<a {{ if .Params.external_link }}
href="{{ .Params.external_link }}"
{{ else }}
id="project{{.Title}}"
{{ end }}>
<img src="{{ .Params.image | default "{{ .Params.placeholderimg }}" }}"/>
</a>
</figure>
</div>
<div class="card-content has-text-centered top-pad">
<a {{ if .Params.external_link }}
href="{{ .Params.external_link }}"
{{ else }}
id="project{{.Title}}"
{{ end }}>
{{ .Title }}
</a>
</div>
</div>
</div>
{{ end }} {{ end }}
</div>
2017-03-13 09:14:02 +00:00
</div>
2017-11-13 21:01:53 +00:00
</div>
<!-- End Projects container -->
2017-11-13 21:01:53 +00:00
<!-- Projects modals -->
{{ range sort .Pages }} {{ if eq .Section "projects" }}
<div class="modal" id="modal{{.Title}}">
<div class="modal-background"></div>
<div class="modal-card">
{{ with .Title }}
<header class="modal-card-header bottom-pad">
<p class="modal-card-title has-text-centered">{{ . }}</p>
</header>
{{ end }}
{{ if .Params.image }}
<img src="{{ .Params.image }}" class="img-responsive img-centered">
{{ end }}
{{ if .Content }}
<section class="modal-card-body markdown">
{{ .Content }}
</section>
{{ end }}
2017-03-13 09:14:02 +00:00
</div>
2017-11-13 21:01:53 +00:00
<button class="modal-close is-large" aria-label="close" id="close{{.Title}}"></button>
</div>
<script>
$('#project{{.Title}}').click(function() {
$('#modal{{.Title}}').addClass('is-active');
});
$('#close{{.Title}}').click(function() {
$('#modal{{.Title}}').removeClass('is-active');
});
</script>
{{ end }} {{ end }}
2017-11-13 21:01:53 +00:00
<div class="container has-text-centered top-pad">
<a href="#top">
<i class="fa fa-arrow-up"></i>
</a>
2017-03-13 09:14:02 +00:00
</div>