瀏覽代碼

Trim more whitespace in template logic

digitalcraftsman 7 年之前
父節點
當前提交
fe56862a53
共有 3 個文件被更改,包括 6 次插入6 次删除
  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 查看文件

@@ -1,4 +1,4 @@
1 1
 {{ define "main" -}}
2 2
 <h1>404: Page not found</h1>
3 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 查看文件

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

+ 2
- 2
layouts/partials/sidebar.html 查看文件

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