1
Fork 0

Reformat templates

This commit is contained in:
Jake Howard 2017-07-24 09:19:35 +01:00
parent 6e8797bba2
commit e816a4186e
Signed by: jake
GPG key ID: 57AFB45680EDD477
8 changed files with 66 additions and 69 deletions

View file

@ -1,19 +1,19 @@
{{ partial "page_start.html" . }}
<section id="main" class="container">
{{ partial "content.html" . }}
{{ if ne .Params.hide_pages "true" }}
<div class="row">
{{ $parent := . }}
{{ $valid_pages := where .Site.Pages.ByTitle ".Parent" "!=" nil }}
{{ $valid_pages := where $valid_pages ".Params.hide_in_list" "!=" "true" }}
{{ range where $valid_pages ".Parent.UniqueID" $parent.UniqueID }}
{{ if $parent.Params.show_images }}
{{ partial "box_image.html" . }}
{{ else }}
{{ partial "box.html" . }}
<section id="main" class="container">
{{ partial "content.html" . }}
{{ if ne .Params.hide_pages "true" }}
<div class="row">
{{ $parent := . }}
{{ $valid_pages := where .Site.Pages.ByTitle ".Parent" "!=" nil }}
{{ $valid_pages := where $valid_pages ".Params.hide_in_list" "!=" "true" }}
{{ range where $valid_pages ".Parent.UniqueID" $parent.UniqueID }}
{{ if $parent.Params.show_images }}
{{ partial "box_image.html" . }}
{{ else }}
{{ partial "box.html" . }}
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
</section>
</div>
{{ end }}
</section>
{{ partial "page_end.html" . }}

View file

@ -1,5 +1,5 @@
{{ partial "page_start.html" . }}
<section id="main" class="container">
{{ partial "content.html" . }}
</section>
<section id="main" class="container">
{{ partial "content.html" . }}
</section>
{{ partial "page_end.html" . }}

View file

@ -5,7 +5,7 @@
<link rel="alternate" type="application/rss+xml" href="{{ .Site.RSSLink }}" />
<meta name="superfish" content="nofish" />
<meta name="application-name" content="{{ .Site.Title }}" />
<link rel="icon" type="image/png" href="/img/logo-transparent.png" /s>
<link rel="icon" type="image/png" href="/img/logo-transparent.png" />
<link rel="stylesheet" href="/css/style.css" />

View file

@ -1,42 +1,42 @@
<header id="header" {{ if .IsHome }}class="alt"{{ end }}>
<h1><a href="/" class="navbar-brand">{{ title .Site.Title }}</a></h1>
<nav id="nav">
<ul>
{{ $home := .Site.GetPage "home" }}
{{ range where .Site.Pages.ByTitle "Kind" "section" }}
{{ if eq .Parent $home }}
{{ $valid_children := where .Site.Pages.ByTitle ".Parent" "!=" nil }}
{{ $children := where $valid_children ".Parent.UniqueID" .UniqueID }}
{{ $children := where $children ".Params.hide_in_nav" "!=" "true" }}
<li class="top-level">
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
{{ if $children }}
<ul>
{{ range first .Site.Params.nav_items $children }}
<li>
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
<ul>
{{ range .Pages }}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
</ul>
</li>
{{ end }}
{{ if ge (len $children) .Site.Params.nav_items }}
<li><a href="{{ .Permalink }}"><i>See more</i></a></li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
<header id="header" {{ if .IsHome }}class="alt"{{ end }}>
<h1><a href="/" class="navbar-brand">{{ title .Site.Title }}</a></h1>
<nav id="nav">
<ul>
{{ $home := .Site.GetPage "home" }}
{{ range where .Site.Pages.ByTitle "Kind" "section" }}
{{ if eq .Parent $home }}
{{ $valid_children := where .Site.Pages.ByTitle ".Parent" "!=" nil }}
{{ $children := where $valid_children ".Parent.UniqueID" .UniqueID }}
{{ $children := where $children ".Params.hide_in_nav" "!=" "true" }}
<li class="top-level">
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
{{ if $children }}
<ul>
{{ range first .Site.Params.nav_items $children }}
<li>
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
<ul>
{{ range .Pages }}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
</ul>
</li>
{{ end }}
{{ if ge (len $children) .Site.Params.nav_items }}
<li><a href="{{ .Permalink }}"><i>See more</i></a></li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
{{ end }}
{{ range where .Site.Pages.ByTitle "Kind" "page" }}
{{ if eq .Section "" }}
<li class="top-level"><a href="{{ .Permalink }}">{{ title .LinkTitle }}</a></li>
{{ end }}
{{ range where .Site.Pages.ByTitle "Kind" "page" }}
{{ if eq .Section "" }}
<li class="top-level"><a href="{{ .Permalink }}">{{ title .LinkTitle }}</a></li>
{{ end }}
<li class="top-level"><a class="show-mobile" href="/">Home</a></li>
</ul>
</nav>
</header>
{{ end }}
<li class="top-level"><a class="show-mobile" href="/">Home</a></li>
</ul>
</nav>
</header>

View file

@ -1,5 +1,5 @@
{{ partial "footer.html" . }}
</div>
{{ partial "scripts.html" . }}
</body>
</body>
</html>

View file

@ -7,7 +7,5 @@
{{ else }}
<body>
{{ end }}
{{ partial "navbar.html" . }}
<div id="page-wrapper">
{{ partial "navbar.html" . }}
<div id="page-wrapper">

View file

@ -1,7 +1,6 @@
{{ if eq .Section "posts" }}
{{ .Summary | truncate .Site.Params.summary_length "..." }}
{{ else }}
{{ if .Params.subtitle }}
{{ .Params.subtitle | markdownify }}
{{ else if .Params.repo }}

View file

@ -9,10 +9,10 @@
<div id="light-gallery" class="row">
{{ range $index, $element := $photoset_orig.photo }}
{{ $thumb := (index $photoset_thumb.photo $index).url_sq }}
<a href="{{ $element.url_o }}" title="{{ $element.title }}" class="col-2">
<img src="{{ $thumb }}" alt="{{ $element.title }}"/>
</a>
{{ $thumb := (index $photoset_thumb.photo $index).url_sq }}
<a href="{{ $element.url_o }}" title="{{ $element.title }}" class="col-2">
<img src="{{ $thumb }}" alt="{{ $element.title }}"/>
</a>
{{ end }}
</div>