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,11 +1,11 @@
{{ define "header" -}}
{{ define "header" }}
{{ partial "header.html" . }}
{{- end }}
{{ end }}
{{ define "content" -}}
{{ define "content" }}
<h1>404: Page not found</h1>
<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>
{{- end }}
{{ end }}
{{ define "footer" -}}
{{- end }}
{{ define "footer" }}
{{ end }}

View File

@ -1,11 +1,11 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
{{ block "header" . -}}{{- end }}
{{ block "header" . }}{{ end }}
<body {{ if .Site.Params.themeColor }}class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{ end }}"{{end}}>
{{ partial "sidebar.html" . -}}
{{ partial "sidebar.html" . }}
<div class="content container">
{{ block "content" . -}}{{- end }}
{{ block "content" . }}{{ end }}
</div>
{{ block "footer" . -}}{{- end }}
{{ block "footer" . }}{{ end }}
</body>
</html>

View File

@ -1,11 +1,11 @@
{{ define "header" -}}
{{ define "header" }}
{{ partial "header.html" . }}
{{- end -}}
{{ end }}
{{ define "content" -}}
{{ define "content" }}
{{ partial "page-list/content.html" . }}
{{- end -}}
{{ end }}
{{ define "footer" -}}
{{ define "footer" }}
{{ partial "page-list/footer.html" . }}
{{- end }}
{{ end }}

View File

@ -1,13 +1,13 @@
{{ define "header" -}}
{{ define "header" }}
{{ partial "page-single/variables-init.html" . }}
{{ partial "header.html" . }}
{{- end -}}
{{ end }}
{{ define "content" -}}
{{ define "content" }}
{{ partial "page-single/content.html" . }}
{{- end -}}
{{ end }}
{{ define "footer" -}}
{{ define "footer" }}
{{ partial "page-single/footer.html" . }}
{{ partial "page-single/variables-deinit.html" . }}
{{- end -}}
{{ end }}

View File

@ -1,13 +1,13 @@
{{- define "header" -}}
{{- partial "header.html" . -}}
{{- end -}}
{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
{{- define "content" -}}
{{ define "content" }}
<div class="post">
<h1>{{ .Title }}</h1>
{{ .Content }}
</div>
{{- end -}}
{{ end }}
{{- define "footer" -}}
{{- end -}}
{{ define "footer" }}
{{ end }}

View File

@ -1,10 +1,10 @@
{{ define "header" -}}
{{ define "header" }}
{{ partial "header.html" . }}
{{- end }}
{{ end }}
{{ define "content" -}}
{{ define "content" }}
<div class="post-list">
{{ range (where .Data.Pages "Type" "not in" (slice "about" "portfolio")).GroupBy "Section" -}}
{{ range (where .Data.Pages "Type" "not in" (slice "about" "portfolio")).GroupBy "Section" }}
{{ range .Pages }}
<div class="post-list__item">
<span class="item__title--big">
@ -14,21 +14,21 @@
{{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") }}
</span>
{{ .Summary }}
{{ if .Truncated -}}
{{ if .Truncated }}
<div class="read-more-link">
<a href="{{ .RelPermalink }}">Read More…</a>
</div>
{{- end }}
{{ end }}
</div>
{{- end -}}
{{- end }}
{{ end }}
{{ end }}
</div>
{{- end }}
{{ end }}
{{ define "footer" -}}
{{ if .Site.GoogleAnalytics -}}
{{ define "footer" }}
{{ 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" . }}
{{- end }}
{{ end }}

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>

View File

@ -1,11 +1,11 @@
{{ define "header" -}}
{{ define "header" }}
{{ partial "header.html" . }}
{{- end -}}
{{ end }}
{{ define "content" -}}
{{ define "content" }}
{{ partial "portfolio/content.html" . }}
{{- end -}}
{{ end }}
{{ define "footer" -}}
{{ define "footer" }}
{{ partial "portfolio/footer.html" . }}
{{- end }}
{{ end }}

View File

@ -21,8 +21,8 @@
src="{{ (printf "%s%s" $permalink $image) }}"
{{ end }}
{{ if .Get "alt" }}alt="{{ .Get "alt" | markdownify | plainify }}"
{{- else if .Get "caption" }}alt="{{ .Get "caption" | markdownify | plainify }}"
{{- end }}
{{ else if .Get "caption" }}alt="{{ .Get "caption" | markdownify | plainify }}"
{{ end }}
{{ with .Get "align" }}align="{{ . }}"{{ end }}
width="{{ .Get "width" | default "100%"}}"
{{ with .Get "height" }}width="{{ . }}"{{ end }} />
@ -33,9 +33,9 @@
<span class="img--caption">
Figure {{ $.Page.Scratch.Get "fig" }}. {{ $fig.Get "caption" | markdownify | plainify }}
{{ if .Get "attr" }}
[{{- with .Get "attrlink"}}<a href="{{ . | markdownify }}">{{ end -}}
[{{ with .Get "attrlink"}}<a href="{{ . | markdownify }}">{{ end }}
{{ .Get "attr" | markdownify }}
{{- if .Get "attrlink"}}</a>{{- end }}]
{{ if .Get "attrlink"}}</a>{{ end }}]
{{ end }}
</span>
</figcaption>

View File

@ -1 +1 @@
<kbd>{{- .Get 0 -}}</kbd>
<kbd>{{ .Get 0 }}</kbd>

View File

@ -1,4 +1,4 @@
<blockquote {{ with .Get "class" }}class="{{.}}"{{ end }}>
<strong>{{ .Get 0 | default "Note" }}</strong><br>
{{- .Inner -}}
</blockquote>
{{ .Inner }}
</blockquote>

View File

@ -1,4 +1,4 @@
<blockquote class="warning">
<strong>{{ .Get 0 | default "Warning" }}</strong><br>
{{- .Inner -}}
{{ .Inner }}
</blockquote>