aboutsummaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
authorolOwOlo <26087907+olOwOlo@users.noreply.github.com>2018-07-10 01:41:34 +0800
committerolOwOlo <26087907+olOwOlo@users.noreply.github.com>2018-07-10 01:41:34 +0800
commit5e356c5f635d45f0241854d9f43f38b2f0bd44f9 (patch)
tree52d12fa3e71c1f843c385271c2f22b8842ddc0ba /layouts/_default
parentd3a1ab071c983586b474c5e5dc0fa6afb0babce8 (diff)
style(*): google js style & trim whitespace
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/baseof.html2
-rw-r--r--layouts/_default/section.html8
-rw-r--r--layouts/_default/single.html2
-rw-r--r--layouts/_default/taxonomy.html26
-rw-r--r--layouts/_default/terms.html32
5 files changed, 35 insertions, 35 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 0693148..c9cb88b 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,5 +1,5 @@
{{ if ne .Site.Params.version "3.x" -}}
-{{ errorf "\n\nThere are two possible situations that led to this error:\n 1. You haven't copied the config.toml yet. See https://github.com/olOwOlo/hugo-theme-even#installation \n 2. You have an incompatible update. See https://github.com/olOwOlo/hugo-theme-even/blob/master/CHANGELOG.md#300 \n\n有两种可能的情况会导致这个错误发生:\n 1. 你还没有复制 config.toml 参考 https://github.com/olOwOlo/hugo-theme-even/blob/master/README-zh.md#installation \n 2. 你进行了一次不兼容的更新 参考 https://github.com/olOwOlo/hugo-theme-even/blob/master/CHANGELOG.md#300 \n" -}}
+ {{ errorf "\n\nThere are two possible situations that led to this error:\n 1. You haven't copied the config.toml yet. See https://github.com/olOwOlo/hugo-theme-even#installation \n 2. You have an incompatible update. See https://github.com/olOwOlo/hugo-theme-even/blob/master/CHANGELOG.md#300 \n\n有两种可能的情况会导致这个错误发生:\n 1. 你还没有复制 config.toml 参考 https://github.com/olOwOlo/hugo-theme-even/blob/master/README-zh.md#installation \n 2. 你进行了一次不兼容的更新 参考 https://github.com/olOwOlo/hugo-theme-even/blob/master/CHANGELOG.md#300 \n" -}}
{{ end -}}
<!DOCTYPE html>
<html lang="{{ .Site.Language }}">
diff --git a/layouts/_default/section.html b/layouts/_default/section.html
index fbe80f1..2b159e4 100644
--- a/layouts/_default/section.html
+++ b/layouts/_default/section.html
@@ -1,6 +1,6 @@
-{{ define "title" }}{{ T "archive" }} - {{ .Site.Title }}{{ end }}
+{{- define "title" }}{{ T "archive" }} - {{ .Site.Title }}{{ end -}}
-{{ define "content"}}
+{{- define "content" }}
{{- $paginator := .Paginate .Data.Pages.ByDate.Reverse .Site.Params.archivePaginate }}
<section id="archive" class="archive">
{{- if and (not $paginator.HasPrev) .Site.Params.showArchiveCount }}
@@ -14,7 +14,7 @@
{{- range $index, $element := $paginator.Pages -}}
{{- $thisYear := $element.Date.Format "2006" }}
{{- $lastElement := $index | add -1 | index $paginator.Pages }}
- {{ if or (eq $index 0) ( ne ($lastElement.Date.Format "2006") $thisYear ) }}
+ {{- if or (eq $index 0) ( ne ($lastElement.Date.Format "2006") $thisYear ) }}
<div class="collection-title">
<h2 class="archive-year">{{ $thisYear }}</h2>
</div>
@@ -47,4 +47,4 @@
</a>
{{- end }}
</nav>
-{{ end }}
+{{- end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index a1c30fd..96fe3bf 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,7 +1,7 @@
{{ define "content" -}}
<article class="post">
<div class="post-content">
- {{ .Content }}
+ {{ .Content }}
</div>
</article>
{{- end }} \ No newline at end of file
diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html
index d0c8d43..2be015a 100644
--- a/layouts/_default/taxonomy.html
+++ b/layouts/_default/taxonomy.html
@@ -1,21 +1,21 @@
-{{ define "title" }}{{ .Title }} · {{ .Site.Title }}{{ end }}
+{{- define "title" }}{{ .Title }} · {{ .Site.Title }}{{ end -}}
-{{ define "content"}}
-{{ $paginator := .Paginate .Data.Pages.ByDate.Reverse .Site.Params.archivePaginate }}
+{{- define "content" }}
+{{- $paginator := .Paginate .Data.Pages.ByDate.Reverse .Site.Params.archivePaginate -}}
<section id="archive" class="archive">
- {{ if not $paginator.HasPrev }}
- {{ if eq .Data.Plural "tags" }}
+ {{ if not $paginator.HasPrev -}}
+ {{ if eq .Data.Plural "tags" -}}
<div class="archive-title tag">
<h2 class="archive-name">{{ .Title }}</h2>
</div>
- {{ else if eq .Data.Plural "categories" }}
+ {{- else if eq .Data.Plural "categories" -}}
<div class="archive-title category">
<h2 class="archive-name">{{ .Title }}</h2>
</div>
- {{ end }}
- {{ end }}
+ {{- end }}
+ {{- end }}
- {{ range $paginator.Pages }}
+ {{ range $paginator.Pages -}}
<div class="archive-post">
<span class="archive-post-time">
{{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
@@ -26,21 +26,21 @@
</a>
</span>
</div>
- {{ end }}
+ {{- end }}
</section>
<!-- pagination -->
<nav class="pagination">
- {{ with $paginator.Prev }}
+ {{ with $paginator.Prev -}}
<a class="prev" href="{{ .URL }}">
<i class="iconfont icon-left"></i>
<span class="prev-text">{{ T "prevPage" }}</span>
</a>
{{- end }}
- {{ with $paginator.Next }}
+ {{ with $paginator.Next -}}
<a class="next" href="{{ .URL }}">
<span class="next-text">{{ T "nextPage" }}</span>
<i class="iconfont icon-right"></i>
</a>
{{- end }}
</nav>
-{{ end }}
+{{- end }}
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
index 04b98f8..08498f6 100644
--- a/layouts/_default/terms.html
+++ b/layouts/_default/terms.html
@@ -1,44 +1,44 @@
-{{ define "title" }}{{ T .Data.Plural }} - {{ .Site.Title }}{{ end }}
+{{- define "title" }}{{ T .Data.Plural }} - {{ .Site.Title }}{{ end -}}
-{{ define "content" }}
+{{- define "content" -}}
{{ $name := .Data.Plural -}}
{{ $terms := .Data.Terms.ByCount -}}
{{ $length := len $terms -}}
- {{ if eq $name "categories" }}
+ {{ if eq $name "categories" -}}
<div class="categories">
<div class="categories-title">
- {{ if eq $length 0 }}
+ {{ if eq $length 0 -}}
{{ T "zeroCategoryCounter" }}
- {{ else }}
+ {{- else -}}
{{ T "categoryCounter" $length }}
- {{ end }}
+ {{- end }}
</div>
<div class="categories-tags">
- {{ range $key, $value := $terms }}
+ {{ range $key, $value := $terms -}}
<a class="category-link" href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}/">
{{ $value.Term }}
<span class="category-count">{{ len $value.Pages }}</span>
</a>
- {{ end }}
+ {{ end -}}
</div>
</div>
- {{ else if eq $name "tags" }}
+ {{- else if eq $name "tags" -}}
<div class="tag-cloud">
<div class="tag-cloud-title">
- {{ if eq $length 0 }}
+ {{ if eq $length 0 -}}
{{ T "zeroTagCounter" }}
- {{ else }}
+ {{- else -}}
{{ T "tagCounter" $length }}
- {{ end }}
+ {{- end }}
</div>
<div class="tag-cloud-tags">
- {{ range $key, $value := $terms }}
+ {{- range $key, $value := $terms }}
<a href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}/">
{{ $value.Term }}
<span class="tag-count">{{ len $value.Pages }}</span>
</a>
- {{ end }}
+ {{ end -}}
</div>
</div>
- {{ end }}
-{{ end }} \ No newline at end of file
+ {{- end }}
+{{- end }} \ No newline at end of file