Extract box to partial
This commit is contained in:
parent
f1f87aaddd
commit
733bfb46f7
3 changed files with 26 additions and 22 deletions
|
@ -11,18 +11,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{ range .Pages.ByTitle }}
|
{{ range .Pages.ByTitle }}
|
||||||
<div class="col-sm-6">
|
{{ partial "box.html" . }}
|
||||||
<section class="box special">
|
|
||||||
{{ if .Params.image }}
|
|
||||||
<span class="image featured"><img src="{{ .Params.image }}" alt="{{ .Title }} featured image" /></span>
|
|
||||||
{{ end }}
|
|
||||||
<h3>{{ title .Title }}</h3>
|
|
||||||
<p>{{ .Summary }}</p>
|
|
||||||
<ul class="actions">
|
|
||||||
<li><a href="{{ .Permalink }}" class="button alt">Read More</a></li>
|
|
||||||
</ul>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -40,21 +40,24 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<div class="box special">
|
||||||
|
<h2>Projects</h2>
|
||||||
|
<div class="row">
|
||||||
|
{{ range first 6 (where .Data.Pages.ByDate "Kind" "projects") }}
|
||||||
|
{{ if ne .Section "" }}
|
||||||
|
{{ partial "box.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
<h4><a href="/projects/">All Projects</a></h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="box special">
|
<div class="box special">
|
||||||
<h2>Recent Posts</h2>
|
<h2>Recent Posts</h2>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{ range first 6 (where .Data.Pages.ByDate "Kind" "page") }}
|
{{ range first 6 (where .Data.Pages.ByDate "Kind" "page") }}
|
||||||
{{ if ne .Section "" }}
|
{{ if ne .Section "" }}
|
||||||
<div class="col-sm-6">
|
{{ partial "box.html" . }}
|
||||||
<section class="box special">
|
|
||||||
<span class="image featured"><img src="{{ .Params.image }}" /></span>
|
|
||||||
<h3>{{ .Title }}</h3>
|
|
||||||
<p>{{ .Summary }}</p>
|
|
||||||
<ul class="actions">
|
|
||||||
<li><a href="{{ .Permalink }}" class="button alt">Read More</a></li>
|
|
||||||
</ul>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
12
layouts/partials/box.html
Normal file
12
layouts/partials/box.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<section class="box special">
|
||||||
|
{{ if .Params.image }}
|
||||||
|
<span class="image featured"><img src="{{ .Params.image }}" alt="{{ .Title }} featured image" /></span>
|
||||||
|
{{ end }}
|
||||||
|
<h3>{{ title .Title }}</h3>
|
||||||
|
<p>{{ .Summary }}</p>
|
||||||
|
<ul class="actions">
|
||||||
|
<li><a href="{{ .Permalink }}" class="button alt">Read More</a></li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</div>
|
Loading…
Reference in a new issue