removes all space consuming symbols in templates

This commit is contained in:
Huy Tran 2018-07-30 07:41:49 +10:00
parent c5ab13bf48
commit 90a8c7d5af
26 changed files with 126 additions and 126 deletions

View file

@ -1,4 +1,4 @@
{{- if .RSSLink -}}
{{ if .RSSLink }}
<!-- RSS -->
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link href="{{ .RSSLink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />

View file

@ -4,15 +4,15 @@
{{ "<!-- Enable responsiveness on mobile devices -->" | safeHTML }}
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
{{ .Hugo.Generator }}
{{- if .IsHome }}
{{ $.Scratch.Set "theTitle" .Site.Title -}}
{{ if .IsHome }}
{{ $.Scratch.Set "theTitle" .Site.Title }}
{{else}}
{{ $.Scratch.Add "theTitle" .Title}}
{{ $.Scratch.Add "theTitle" " • "}}
{{ $.Scratch.Add "theTitle" .Site.Title}}
{{- end -}}
{{ end }}
<title>{{ $.Scratch.Get "theTitle" }}</title>
{{ with .Site.Params.meta.description -}}<meta name="description" content="{{ . }}">{{- end }}
{{ with .Site.Params.meta.keywords -}}<meta name="keywords" content="{{.}}">{{- end }}
{{ with .Site.Params.meta.description }}<meta name="description" content="{{ . }}">{{ end }}
{{ with .Site.Params.meta.keywords }}<meta name="keywords" content="{{.}}">{{ end }}
{{ template "_internal/twitter_cards.html" . }}
{{ template "_internal/opengraph.html" . }}

View file

@ -1,8 +1,8 @@
{{- if .Site.Params.highlightjs -}}
{{ if .Site.Params.highlightjs }}
<!-- highlightjs -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/{{ .Site.Params.highlightjsstyle | default "default" }}.min.css">
{{- end -}}
{{ if .Site.Params.PygmentsUseClasses -}}
{{ end }}
{{ if .Site.Params.PygmentsUseClasses }}
<!-- Pygments Syntax -->
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/syntax.min.css">
{{- end }}
{{ end }}

View file

@ -1,4 +1,4 @@
{{ if .Site.Params.highlightjs -}}
{{ if .Site.Params.highlightjs }}
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
{{ with .Site.Params.highlightjslanguages }}
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/{{.}}.min.js"></script>
@ -7,4 +7,4 @@
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
</script>
{{- end }}
{{ end }}

View file

@ -1,6 +1,6 @@
<span class="section__title">{{ .Title }}</span>
<ul class="posts">
{{- with .Data.Pages -}}
{{ with .Data.Pages }}
{{ partial "posts-list.html" . }}
{{- end }}
{{ end }}
</ul>

View file

@ -1,5 +1,5 @@
{{ if .Site.GoogleAnalytics -}}
{{ if .Site.GoogleAnalytics }}
<!-- Google Analytics -->
{{- template "_internal/google_analytics_async.html" . -}}
{{- end }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
{{ partial "footer/font-awesome-js.html" . }}

View file

@ -6,12 +6,12 @@
{{.}}
</span>
{{ end }}
{{ partial "page-single/post-meta-top.html" . }}
{{ partial "page-single/post-meta.html" . }}
</header>
<div class="post">
{{ .Content }}
</div>
{{ partial "page-single/post-meta-bottom.html" . }}
{{ partial "page-single/post-navigation.html" . }}
{{ partial "page-single/post-related.html" . }}
{{- partial "page-single/post-comment.html" . -}}
{{ partial "page-single/post-comment.html" . }}
</article>

View file

@ -1,6 +1,6 @@
{{ if .Site.GoogleAnalytics -}}
{{ if .Site.GoogleAnalytics }}
<!-- Google Analytics -->
{{- template "_internal/google_analytics_async.html" . -}}
{{- end }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
{{ partial "footer/font-awesome-js.html" . }}
{{ partial "highlight-js.html" . }}

View file

@ -1,7 +1,7 @@
{{- if ne .Params.showcomments false -}}
{{ if .Site.DisqusShortname -}}
{{- partial "page-single/comment/disqus.html" . -}}
{{- else if .Site.Params.GraphCommentId -}}
{{- partial "page-single/comment/graphcomment.html" . -}}
{{- end -}}
{{- end }}
{{ if ne .Params.showcomments false }}
{{ if .Site.DisqusShortname }}
{{ partial "page-single/comment/disqus.html" . }}
{{ else if .Site.Params.GraphCommentId }}
{{ partial "page-single/comment/graphcomment.html" . }}
{{ end }}
{{ end }}

View file

@ -1,17 +1,17 @@
{{ $enabledPostNavigation := .Site.Params.postNavigation | default true }}
{{ if $enabledPostNavigation }}
<div class="post--navigation post--navigation-single">
{{ with .PrevInSection -}}
{{ with .PrevInSection }}
<a href="{{ .RelPermalink }}" class="post--navigation-prev">
<i aria-hidden="true" class="fa fa-chevron-left"></i>
<span class="navigation-tittle">{{ .Title }}</span>
</a>
{{- end }}
{{ with .NextInSection -}}
{{ end }}
{{ with .NextInSection }}
<a href="{{ .RelPermalink }}" class="post--navigation-next">
<span class="navigation-tittle">{{ .Title }}</span>
<i aria-hidden="true" class="fa fa-chevron-right"></i>
</a>
{{- end }}
{{ end }}
</div>
{{ end }}

View file

@ -1,6 +1,6 @@
{{ if .Site.Params.relatedPosts }}
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related -}}
{{ with $related }}
<div class="post__related">
<!-- related content -->
<h2>Related Articles</h2>

View file

@ -1,5 +1,5 @@
{{ if .Site.GoogleAnalytics -}}
{{ if .Site.GoogleAnalytics }}
<!-- Google Analytics -->
{{- template "_internal/google_analytics_async.html" . -}}
{{- end }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
{{ partial "footer/font-awesome-js.html" . }}

View file

@ -1,6 +1,6 @@
<!-- Sidebar -->
<div class="sidebar">
<div class="container {{ with .Site.Params.sidebarSticky -}}sidebar-sticky{{- end }}">
<div class="container {{ with .Site.Params.sidebarSticky }}sidebar-sticky{{ end }}">
<div class="sidebar-about">
<span class="site__title">
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>

View file

@ -1,27 +1,27 @@
<div>
<ul class="sidebar-nav">
{{ $currentPage := . }}
{{- range .Site.Menus.main -}}
{{ if .HasChildren -}}
{{ range .Site.Menus.main }}
{{ if .HasChildren }}
<li {{ if $currentPage.HasMenuCurrent "main" . }}class="active"{{ end }}>
<a href="#">{{ .Pre }}
<span>{{ .Name }}</span>
</a>
<ul class="sidebar-nav">
{{- range .Children -}}
{{ range .Children }}
<li {{ if $currentPage.IsMenuCurrent "main" . }}class="active"{{ end }}>
<a href="{{ .URL }}">{{ .Name | title }}</a>
</li>
{{- end -}}
{{ end }}
</ul>
{{- else -}} <!-- No children -->
{{ else }} <!-- No children -->
<li>
<a href="{{.URL}}">{{ .Pre }}
<span>{{ .Name | title }}</span>
</a>
</li>
{{- end -}}
{{- end }}
{{ end }}
{{ end }}
</li>
</ul>
</div>

View file

@ -1,38 +1,38 @@
<section class="social">
{{ with .Site.Params.social.twitter -}}
{{ with .Site.Params.social.twitter }}
<a href="https://twitter.com/{{.}}"><i class="fab fa-twitter fa-lg" aria-hidden="true"></i></a>
{{- end }}
{{ with .Site.Params.social.facebook -}}
{{ end }}
{{ with .Site.Params.social.facebook }}
&nbsp;<a href="https://facebook.com/{{.}}"><i class="fab fa-facebook-f"></i></a>
{{- end }}
{{ with .Site.Params.social.github -}}
{{ end }}
{{ with .Site.Params.social.github }}
&nbsp;<a href="https://github.com/{{.}}"><i class="fab fa-github fa-lg" aria-hidden="true"></i></a>
{{- end }}
{{ with .Site.Params.social.bitbucket -}}
{{ end }}
{{ with .Site.Params.social.bitbucket }}
&nbsp;<a href="https://bitbucket.org/{{.}}"><i class="fab fa-bitbucket fa-lg" aria-hidden="true"></i></a>
{{- end }}
{{ with .Site.Params.social.gitlab -}}
{{ end }}
{{ with .Site.Params.social.gitlab }}
&nbsp;<a href="https://gitlab.com/{{.}}"><i class="fab fa-gitlab fa-lg" aria-hidden="true"></i></a>
{{- end }}
{{ with .Site.Params.social.instagram -}}
{{ end }}
{{ with .Site.Params.social.instagram }}
&nbsp;<a href="https://instagram.com/{{.}}"><i class="fab fa-instagram fa-lg" aria-hidden="true"></i></a>
{{- end }}
{{ with .Site.Params.social.linkedin -}}
{{ end }}
{{ with .Site.Params.social.linkedin }}
&nbsp;<a href="https://linkedin.com/in/{{.}}"><i class="fab fa-linkedin fa-lg" aria-hidden="true"></i></a>
{{- end }}
{{ with .Site.Params.social.stackoverflow -}}
{{ end }}
{{ with .Site.Params.social.stackoverflow }}
&nbsp;<a href="https://stackoverflow.com/users/{{.}}"><i class="fab fa-stack-overflow fa-lg" aria-hidden="true"></i></a>
{{- end }}
{{ end }}
{{ with .Site.Params.social.medium}}
&nbsp;<a href="https://medium.com/@{{.}}"><i class="fab fa-medium fa-lg" aria-hidden="true"></i></a>
{{- end }}
{{ with .Site.Params.social.xing -}}
{{ end }}
{{ with .Site.Params.social.xing }}
&nbsp;<a href="https://www.xing.com/profile/{{.}}"><i class="fab fa-xing fa-lg" aria-hidden="true"></i></a>
{{- end }}
{{ with .Site.Params.social.keybase -}}
{{ end }}
{{ with .Site.Params.social.keybase }}
&nbsp;<a href="https://keybase.io/{{.}}"><i class="fab fa-keybase fa-lg" aria-hidden="true"></i></a>
{{- end }}
{{ with .Site.Params.social.email -}}
{{ end }}
{{ with .Site.Params.social.email }}
&nbsp;<a href="mailto:{{.}}"><i class="fas fa-at fa-lg" aria-hidden="true"></i></a>
{{- end }}
{{ end }}
</section>