Browse Source

Trim more whitespace in template logic

digitalcraftsman 7 years ago
parent
commit
fe56862a53
3 changed files with 6 additions and 6 deletions
  1. 1
    1
      layouts/404.html
  2. 3
    3
      layouts/partials/head.html
  3. 2
    2
      layouts/partials/sidebar.html

+ 1
- 1
layouts/404.html View File

1
 {{ define "main" -}}
1
 {{ define "main" -}}
2
 <h1>404: Page not found</h1>
2
 <h1>404: Page not found</h1>
3
 <p class="lead">Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. <a href="{{ .Site.BaseURL }}">Head back home</a> to try finding it again.</p>
3
 <p class="lead">Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. <a href="{{ .Site.BaseURL }}">Head back home</a> to try finding it again.</p>
4
-{{- end }}
4
+{{-1 end }}

+ 3
- 3
layouts/partials/head.html View File

8
   <!-- Enable responsiveness on mobile devices-->
8
   <!-- Enable responsiveness on mobile devices-->
9
   <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
9
   <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
10
 
10
 
11
-  {{ if .IsHome }}
11
+  {{ if .IsHome -}}
12
   <title>{{ .Site.Title }}</title>
12
   <title>{{ .Site.Title }}</title>
13
-  {{ else }}
13
+  {{- else -}}
14
   <title>{{ .Title }} &middot; {{ .Site.Title }}</title>
14
   <title>{{ .Title }} &middot; {{ .Site.Title }}</title>
15
-  {{ end }}
15
+  {{- end }}
16
 
16
 
17
   <!-- CSS -->
17
   <!-- CSS -->
18
   <link rel="stylesheet" href="{{ .Site.BaseURL }}css/print.css" media="print">
18
   <link rel="stylesheet" href="{{ .Site.BaseURL }}css/print.css" media="print">

+ 2
- 2
layouts/partials/sidebar.html View File

9
 
9
 
10
     <ul class="sidebar-nav">
10
     <ul class="sidebar-nav">
11
       <li><a href="{{ .Site.BaseURL }}">Home</a> </li>
11
       <li><a href="{{ .Site.BaseURL }}">Home</a> </li>
12
-      {{ range .Site.Menus.main }}
12
+      {{ range .Site.Menus.main -}}
13
         <li><a href="{{.URL}}"> {{ .Name }} </a></li>
13
         <li><a href="{{.URL}}"> {{ .Name }} </a></li>
14
-      {{end}}
14
+      {{- end }}
15
     </ul>
15
     </ul>
16
 
16
 
17
     <p>{{ with .Site.Params.copyright }}{{.}}{{ else }}&copy; {{ now.Format "2006"}}. All rights reserved. {{end}}</p>
17
     <p>{{ with .Site.Params.copyright }}{{.}}{{ else }}&copy; {{ now.Format "2006"}}. All rights reserved. {{end}}</p>