diff options
| author | Track3 <pengliabc@live.cn> | 2018-12-12 00:02:36 +0800 |
|---|---|---|
| committer | Track3 <pengliabc@live.cn> | 2018-12-12 00:02:36 +0800 |
| commit | 3bb532df30e5ed3cf3713dc450a1a0ec99172e08 (patch) | |
| tree | 4bb9b5db6ff517877618c0e03dbc2eca3de0d076 /layouts | |
| parent | caf088cbfb4899e4d86fcb18373c4093f32c739b (diff) | |
| download | hermit-3bb532df30e5ed3cf3713dc450a1a0ec99172e08.tar.gz | |
Improve code quality & consistency
* Add EditorConfig
* Rebuild animate.css: remove an unused animation
* Slightly rewrite header part
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/404.html | 2 | ||||
| -rw-r--r-- | layouts/_default/baseof.html | 2 | ||||
| -rw-r--r-- | layouts/_default/list.html | 4 | ||||
| -rw-r--r-- | layouts/_default/single.html | 2 | ||||
| -rw-r--r-- | layouts/index.html | 2 | ||||
| -rw-r--r-- | layouts/partials/footer.html | 2 | ||||
| -rw-r--r-- | layouts/partials/header.html | 22 | ||||
| -rw-r--r-- | layouts/partials/social-icons.html | 2 | ||||
| -rw-r--r-- | layouts/posts/rss.xml | 50 | ||||
| -rw-r--r-- | layouts/posts/single.html | 2 |
10 files changed, 43 insertions, 47 deletions
diff --git a/layouts/404.html b/layouts/404.html index c4cee71..535fd1a 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -16,4 +16,4 @@ {{ define "footer" }} <script>let haveHeader = false;</script> -{{ end }}
\ No newline at end of file +{{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index db28f28..66ddb80 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -33,4 +33,4 @@ {{ template "_internal/google_analytics_async.html" . }} </body> -</html>
\ No newline at end of file +</html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 1e8873a..3a5df64 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -3,7 +3,7 @@ {{ end }} {{ define "main" }} - <main class="site-main section-inner thin animated fadeIn faster"> + <main class="site-main section-inner thin animated fadeIn faster"> <h1>{{ .Title }}</h1> {{- if .Content }} <div class="content"> @@ -31,4 +31,4 @@ {{ define "footer" }} {{ partialCached "footer.html" . }} <script>let haveHeader = true;</script> -{{ end }}
\ No newline at end of file +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 8a4c168..53d566d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -19,4 +19,4 @@ {{ define "footer" }} {{ partialCached "footer.html" . }} <script>let haveHeader = true;</script> -{{ end }}
\ No newline at end of file +{{ end }} diff --git a/layouts/index.html b/layouts/index.html index c36f3d3..d2754dc 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -27,4 +27,4 @@ {{ define "footer" }} <script>let haveHeader = false;</script> -{{ end }}
\ No newline at end of file +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 18aeaf3..423ef8f 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,4 +1,4 @@ <footer id="site-footer" class="section-inner thin animated fadeIn faster"> <p>© 2018 <a href="{{ .Site.BaseURL }}">{{ .Site.Author.name }}</a>{{ .Site.Params.footerCopyright | safeHTML }}</p> <p>Made with <a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo</a> · Theme <a href="https://github.com/Track3/hermit" target="_blank" rel="noopener">Hermit</a> · <a href="{{ "posts/index.xml" | absURL }}" target="_blank" title="rss"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rss"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg></a></p> - </footer>
\ No newline at end of file + </footer> diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 7e8f747..8c241fe 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -10,18 +10,14 @@ {{- end }} </nav> </div> - <div class="hdr-right"> - <div class="hdr-icons"> - {{- with .Params.featuredImg }} - <button id="show-img-btn" class="hdr-btn" onclick="showFeaturedImg()"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-image"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg></button> - {{- end }} - {{- with .Site.Params.social }} - <span class="hide-in-mobile"> - {{- partialCached "social-icons.html" . -}} - </span> - {{- end }} - <button id="menu-btn" class="hdr-btn"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button> - </div> + <div class="hdr-right hdr-icons"> + {{- with .Params.featuredImg }} + <button class="hdr-btn" onclick="showFeaturedImg()"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-image"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg></button> + {{- end }} + {{- with .Site.Params.social -}} + <span class="hdr-social hide-in-mobile">{{ partialCached "social-icons.html" . }}</span> + {{- end -}} + <button id="menu-btn" class="hdr-btn"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button> </div> </div> </header> @@ -31,4 +27,4 @@ <li><a href="{{ .URL }}">{{ .Name }}</a></li> {{- end }} </ul> - </div>
\ No newline at end of file + </div> diff --git a/layouts/partials/social-icons.html b/layouts/partials/social-icons.html index 61c44a6..3496bef 100644 --- a/layouts/partials/social-icons.html +++ b/layouts/partials/social-icons.html @@ -1,3 +1,3 @@ {{ range . -}} <a href="{{ .url }}" target="_blank" rel="noopener"><span class="screen-reader-text">{{ .name }}</span>{{ partial "svg.html" . }}</a> -{{- end }}
\ No newline at end of file +{{- end -}} diff --git a/layouts/posts/rss.xml b/layouts/posts/rss.xml index eaf28c0..8db9f49 100644 --- a/layouts/posts/rss.xml +++ b/layouts/posts/rss.xml @@ -1,27 +1,27 @@ <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> - <channel> - <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> - <link>{{ .Permalink }}</link> - <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description> - <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }} - <language>{{.}}</language>{{end}}{{ with .Site.Author.email }} - <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} - <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} - <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} - <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} - {{ with .OutputFormats.Get "RSS" -}} - {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} - {{ end -}} - {{ range .Pages }} - <item> - <title>{{ .Title }}</title> - <link>{{ .Permalink }}</link> - <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> - {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} - <guid>{{ .Permalink }}</guid> - <description>{{ .Summary | html }}</description> - <content type="html">{{ printf `<![CDATA[%s]]>` .Content | safeHTML }}</content> - </item> - {{ end }} - </channel> + <channel> + <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> + <link>{{ .Permalink }}</link> + <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description> + <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }} + <language>{{.}}</language>{{end}}{{ with .Site.Author.email }} + <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} + <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} + <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} + <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} + {{ with .OutputFormats.Get "RSS" -}} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{ end -}} + {{ range .Pages }} + <item> + <title>{{ .Title }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} + <guid>{{ .Permalink }}</guid> + <description>{{ .Summary | html }}</description> + <content type="html">{{ printf `<![CDATA[%s]]>` .Content | safeHTML }}</content> + </item> + {{ end }} + </channel> </rss> diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 2c94eb0..107b6d3 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -55,4 +55,4 @@ {{ define "footer" }} {{ partialCached "footer.html" . }} <script>let haveHeader = true;</script> -{{ end }}
\ No newline at end of file +{{ end }} |
