diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-09-23 12:52:32 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-09-23 12:52:32 +0530 |
| commit | 016dd6e9fae2cff965753c0fe865e11a58018101 (patch) | |
| tree | 8ee6d6ff897612d29d0e0756dddd80b7e6cf5c4d /layouts/partials | |
| parent | 2cb5c9dad5b176fa03ebe72b04c0cd0f63100343 (diff) | |
(lint) remove unnecessary whitespace
created by hugo's {{ }}
Diffstat (limited to 'layouts/partials')
| -rw-r--r-- | layouts/partials/footer.html | 6 | ||||
| -rw-r--r-- | layouts/partials/head.html | 42 | ||||
| -rw-r--r-- | layouts/partials/header.html | 17 | ||||
| -rw-r--r-- | layouts/partials/homeInfo.html | 10 | ||||
| -rw-r--r-- | layouts/partials/indexProfile.html | 8 | ||||
| -rw-r--r-- | layouts/partials/indexProfileButtons.html | 2 | ||||
| -rw-r--r-- | layouts/partials/share-icons.html | 5 | ||||
| -rw-r--r-- | layouts/partials/social-icons.html | 5 | ||||
| -rw-r--r-- | layouts/partials/toc.html | 8 |
9 files changed, 52 insertions, 51 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 9b07723..3264b91 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -11,11 +11,11 @@ <path d="M12 6H0l6-6z" /></svg> </button> </a> -{{if in site.Params.mainSections .Type }} -{{ $highlight := resources.Get "js/highlight.min.js" | minify | fingerprint}} +{{- if in site.Params.mainSections .Type }} +{{- $highlight := resources.Get "js/highlight.min.js" | minify | fingerprint}} <script src="{{ $highlight.Permalink }}" integrity="{{ $highlight.Data.Integrity }}"></script> <script>hljs.initHighlightingOnLoad();</script> -{{end }} +{{- end }} <script> window.onload = function () { if (localStorage.getItem("menu-scroll-position")) { diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 92fd29e..8e82a28 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -12,39 +12,39 @@ {{- end }} <meta name="author" content="{{ .Params.author | default .Site.Params.author }}"> <link rel="canonical" href="{{ .Permalink }}" /> -{{ if .Site.Params.analytics.google.SiteVerificationTag }} +{{- if .Site.Params.analytics.google.SiteVerificationTag }} <meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" /> -{{end}} +{{- end}} <!-- Styles --> -{{ $anoldhope := resources.Get "css/an-old-hope.min.css" | minify }} -{{ $theme := resources.Get "css/theme-vars.css" | minify }} -{{ $reset := resources.Get "css/reset.css" | minify }} -{{ $header := resources.Get "css/header.css" | minify }} -{{ $main := resources.Get "css/main.css" | minify }} -{{ $postentry := resources.Get "css/post-entry.css" | minify }} -{{ $postsingle := resources.Get "css/post-single.css" | minify }} -{{ $terms := resources.Get "css/terms.css" | minify }} -{{ $archive := resources.Get "css/archive.css" | minify }} -{{ $footer := resources.Get "css/footer.css" | minify }} -{{ $404 := resources.Get "css/404.css" | minify }} -{{ $style := slice $theme $reset $header $main $postentry $postsingle $terms $archive $footer $404 | resources.Concat "stylesheet.css" | minify }} -{{ $stylesheet := slice $anoldhope $style | resources.Concat "css/stylesheet.css" | minify | fingerprint }} +{{- $anoldhope := resources.Get "css/an-old-hope.min.css" | minify }} +{{- $theme := resources.Get "css/theme-vars.css" | minify }} +{{- $reset := resources.Get "css/reset.css" | minify }} +{{- $header := resources.Get "css/header.css" | minify }} +{{- $main := resources.Get "css/main.css" | minify }} +{{- $postentry := resources.Get "css/post-entry.css" | minify }} +{{- $postsingle := resources.Get "css/post-single.css" | minify }} +{{- $terms := resources.Get "css/terms.css" | minify }} +{{- $archive := resources.Get "css/archive.css" | minify }} +{{- $footer := resources.Get "css/footer.css" | minify }} +{{- $404 := resources.Get "css/404.css" | minify }} +{{- $style := slice $theme $reset $header $main $postentry $postsingle $terms $archive $footer $404 | resources.Concat "stylesheet.css" | minify }} +{{- $stylesheet := slice $anoldhope $style | resources.Concat "css/stylesheet.css" | minify | fingerprint }} <link href="{{ $stylesheet.Permalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet" as="style"> -{{ if (and (.Site.Params.profileMode.enabled) (.IsHome)) }} -{{ $profileMode := resources.Get "css/profileMode.css" | minify | fingerprint }} +{{- if (and (.Site.Params.profileMode.enabled) (.IsHome)) }} +{{- $profileMode := resources.Get "css/profileMode.css" | minify | fingerprint }} <link href="{{ $profileMode.Permalink }}" integrity="{{ $profileMode.Data.Integrity }}" rel="preload stylesheet" as="style"> -{{end}} +{{- end }} <!-- Favicons --> <link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}"> <link rel="icon" href="{{ "favicon.ico" | absURL }}"> <!-- Generator --> {{- hugo.Generator }} <!-- RSS --> -{{ range .AlternativeOutputFormats -}} -{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} -{{ end -}} +{{- range .AlternativeOutputFormats -}} +{{- printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} +{{- end -}} <!-- Misc --> {{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} {{- template "_internal/google_analytics_async.html" . }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 6c02c7c..bf31beb 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,10 +1,10 @@ -{{ if eq .Site.Params.defaultTheme "auto" }} +{{- if eq .Site.Params.defaultTheme "auto" }} <script> if (window.matchMedia('(prefers-color-scheme: dark)').matches) { document.body.classList.add('dark'); } </script> -{{ end }} +{{- end }} <header class="header"> <nav class="nav"> {{- if .IsHome }} @@ -12,16 +12,17 @@ {{- else }} <p class="logo"><a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></p> {{- end }} - {{ $currentPage := . }} + {{- $currentPage := . }} <ul class="menu" id="menu" onscroll="menu_on_scroll()"> {{- range .Site.Menus.main }} - {{ $menu_item_url := .URL | relLangURL }} - {{ $page_url:= $currentPage.RelPermalink | relLangURL }} + {{- $menu_item_url := .URL | relLangURL }} + {{- $page_url:= $currentPage.RelPermalink | relLangURL }} <li> <a href="{{ .URL | absLangURL }}"> - <span {{ if eq $menu_item_url $page_url }} - {{/* the menu item links to the current page (with relLangURL) */}} class="active" - {{ end }}>{{ .Name }}</span> + <span {{- if eq $menu_item_url $page_url }} + {{- /* the menu item links to the current page (with relLangURL) */}} class="active" {{- end }}> + {{ .Name }} + </span> </a> </li> {{- end }} diff --git a/layouts/partials/homeInfo.html b/layouts/partials/homeInfo.html index 01d48cb..2b4f18a 100644 --- a/layouts/partials/homeInfo.html +++ b/layouts/partials/homeInfo.html @@ -1,17 +1,17 @@ -{{ with $.Site.Params.homeInfoParams }} +{{- with $.Site.Params.homeInfoParams }} <article class="first-entry"> <header class="entry-header"> - <h2>{{ .Title }}</h2> + <h2>{{- .Title }}</h2> </header> <section class="entry-content"> - <p>{{ .Content | markdownify }}</p> + <p>{{- .Content | markdownify }}</p> </section> <footer class="entry-footer"> {{- with $.Site.Params.socialIcons }} <div class="social-icons"> - {{ partial "social-icons.html" . }} + {{- partial "social-icons.html" . }} </div> {{- end }} </footer> </article> -{{end}}
\ No newline at end of file +{{- end}}
\ No newline at end of file diff --git a/layouts/partials/indexProfile.html b/layouts/partials/indexProfile.html index f0202bc..1e87acf 100644 --- a/layouts/partials/indexProfile.html +++ b/layouts/partials/indexProfile.html @@ -1,7 +1,7 @@ <div class="profile"> - {{ with .Site.Params.profileMode }} + {{- with .Site.Params.profileMode }} <div class="profile_inner"> - {{if .imageUrl}}<img src="{{ .imageUrl}}" alt="{{ .imageTitle | default "profile image" }}" />{{end}} + {{- if .imageUrl}}<img src="{{ .imageUrl}}" alt="{{ .imageTitle | default "profile image" }}" />{{- end}} <h1>{{ .title | default $.Site.Title }}</h1> {{- with $.Site.Params.socialIcons }} <div class="social-icons"> @@ -10,9 +10,9 @@ {{- end }} {{- with .buttons }} <div class="buttons"> - {{ partial "indexProfileButtons.html" . }} + {{- partial "indexProfileButtons.html" . }} </div> {{- end }} </div> - {{end}} + {{- end}} </div>
\ No newline at end of file diff --git a/layouts/partials/indexProfileButtons.html b/layouts/partials/indexProfileButtons.html index 0bdc74d..84e42d2 100644 --- a/layouts/partials/indexProfileButtons.html +++ b/layouts/partials/indexProfileButtons.html @@ -1,4 +1,4 @@ -{{ range . -}} +{{- range . -}} <a class="button" href="{{ .url }}" rel="noopener" title="{{ .name | humanize }}"> <span class="button-inner">{{ .name }}</span> </a> diff --git a/layouts/partials/share-icons.html b/layouts/partials/share-icons.html index 0c83565..64f511f 100644 --- a/layouts/partials/share-icons.html +++ b/layouts/partials/share-icons.html @@ -1,5 +1,5 @@ -{{ $pageurl := .Permalink }} -{{ $title := .Title }} +{{- $pageurl := .Permalink }} +{{- $title := .Title }} <div class="share-buttons"> <p>Share On</p> <a class="share-button-single" target="_blank" rel="noopener noreferrer" @@ -56,5 +56,4 @@ d="M26.49,29.86H5.5a3.37,3.37,0,0,1-2.47-1,3.35,3.35,0,0,1-1-2.47V5.48A3.36,3.36,0,0,1,3,3,3.37,3.37,0,0,1,5.5,2h21A3.38,3.38,0,0,1,29,3a3.36,3.36,0,0,1,1,2.46V26.37a3.35,3.35,0,0,1-1,2.47A3.38,3.38,0,0,1,26.49,29.86Zm-5.38-6.71a.79.79,0,0,0,.85-.66L24.73,9.24a.55.55,0,0,0-.18-.46.62.62,0,0,0-.41-.17q-.08,0-16.53,6.11a.59.59,0,0,0-.41.59.57.57,0,0,0,.43.52l4,1.24,1.61,4.83a.62.62,0,0,0,.63.43.56.56,0,0,0,.4-.17L16.54,20l4.09,3A.9.9,0,0,0,21.11,23.15ZM13.8,20.71l-1.21-4q8.72-5.55,8.78-5.55c.15,0,.23,0,.23.16a.18.18,0,0,1,0,.06s-2.51,2.3-7.52,6.8Z" /> </svg> </a> - </div>
\ No newline at end of file diff --git a/layouts/partials/social-icons.html b/layouts/partials/social-icons.html index 0b9f7c6..d48b1e2 100644 --- a/layouts/partials/social-icons.html +++ b/layouts/partials/social-icons.html @@ -1,3 +1,4 @@ -{{ range . -}} -<a href="{{ .url }}" target="_blank" rel="noopener noreferrer" title="{{ .name | humanize }}" >{{ partial "svg.html" . }}</a> +{{- range . -}} +<a href="{{ .url }}" target="_blank" rel="noopener noreferrer" + title="{{ .name | humanize }}">{{ partial "svg.html" . }}</a> {{- end -}}
\ No newline at end of file diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index f3146dc..06053b6 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -24,10 +24,10 @@ {{- $headerLevel := len (seq $headerLevel) -}} {{/* get id="xyz" */}} - {{ $id := index (findRE "(id=\"(.*?)\")" $header 9) 0 }} + {{- $id := index (findRE "(id=\"(.*?)\")" $header 9) 0 }} - {{/* strip id="" to leave xyz (no way to get regex capturing groups in hugo :( */}} - {{ $cleanedID := replace (replace $id "id=\"" "") "\"" "" }} + {{- /* strip id="" to leave xyz, no way to get regex capturing groups in hugo */ -}} + {{- $cleanedID := replace (replace $id "id=\"" "") "\"" "" }} {{- $header := replaceRE "<h[1-4].*?>((.|\n])+?)</h[1-4]>" "$1" $header -}} {{- if ne $i 0 -}} @@ -69,7 +69,7 @@ {{- end -}} {{- end -}} <!-- {{- $firstHeaderLevel := len (seq (index (findRE "[1-4]" (index $headers 0) 1) 0)) -}} --> - {{ $firstHeaderLevel := $largest }} + {{- $firstHeaderLevel := $largest }} {{- $lastHeaderLevel := len (seq (index (findRE "[1-4]" (index $headers (sub (len $headers) 1)) 1) 0)) -}} </li> {{- range seq (sub $lastHeaderLevel $firstHeaderLevel) -}} |
