Repos / s4g / 26bf47b677
commit 26bf47b677a36c60bbd4dbff2f07583168551049
Author: Nhân <hi@imnhan.com>
Date: Wed Jul 5 00:31:09 2023 +0700
templates: use the whitespace trimming syntax
TIL.
diff --git a/www/_theme/base.tmpl b/www/_theme/base.tmpl
index 8ed98a4..70d9099 100644
--- a/www/_theme/base.tmpl
+++ b/www/_theme/base.tmpl
@@ -12,12 +12,12 @@
<body>
{{template "body" .}}
-{{if .Site.ShowFooter}}
+{{- if .Site.ShowFooter}}
<footer>
© {{if eq .StartYear .Now.Year}}{{.StartYear}}{{else}}{{.StartYear}}–{{.Now.Year}}{{end}} {{.Site.Author.Name}}<br>
Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>
</footer>
-{{end}}
+{{- end}}
</body>
diff --git a/www/_theme/home.tmpl b/www/_theme/home.tmpl
index 09a71d4..b16dd45 100644
--- a/www/_theme/home.tmpl
+++ b/www/_theme/home.tmpl
@@ -8,9 +8,9 @@
<div class="pages">
<a href="{{.Site.HomePath}}">Home</a>
-{{range .Pages}}
+{{- range .Pages}}
<a href="{{.WebPath}}">{{.Meta.Title}}</a>
-{{end}}
+{{- end}}
<a class="feed-link" href="{{.Feed}}">
<img src="{{.Site.HomePath}}_theme/feed.svg" alt="Atom Feed" title="Atom Feed">
</a>
@@ -21,14 +21,14 @@
<p>All posts, newest first:</p>
<ul>
- {{range .Posts}}
- {{if not .Meta.IsDraft}}
- <li>
- {{.Meta.PostedAt.Local.Format "2006-01-02"}}
- — <a href="{{.WebPath}}">{{.Meta.Title}}</a>
- </li>
- {{end}}
- {{end}}
+ {{- range .Posts}}
+ {{- if not .Meta.IsDraft}}
+ <li>
+ {{.Meta.PostedAt.Local.Format "2006-01-02"}} —
+ <a href="{{.WebPath}}">{{.Meta.Title}}</a>
+ </li>
+ {{- end}}
+ {{- end}}
</ul>
<style>
diff --git a/www/_theme/post.tmpl b/www/_theme/post.tmpl
index e8b6de0..4570873 100644
--- a/www/_theme/post.tmpl
+++ b/www/_theme/post.tmpl
@@ -1,15 +1,19 @@
{{define "body"}}
<nav>
<a href="{{.Site.HomePath}}">Home</a>
- {{range .Pages}}<a href="{{$.Site.HomePath}}{{.WebPath}}">{{.Meta.Title}}</a>{{end}}
-{{if not .Post.Meta.PostedAt.IsZero}}
+ {{- range .Pages}}
+ <a href="{{$.Site.HomePath}}{{.WebPath}}">{{.Meta.Title}}</a>
+ {{- end}}
+
+ {{- if not .Post.Meta.PostedAt.IsZero}}
<span class="posted-on">
Posted on
<time datetime="{{.Post.Meta.PostedAt.Local.Format "2006-01-02"}}">
{{.Post.Meta.PostedAt.Local.Format "Monday, 02 Jan 2006"}}
</time>
</span>
-{{end}}
+ {{- end}}
+
</nav>
<hr>
@@ -28,5 +32,4 @@ nav > a {
font-style: italic;
}
</style>
-
{{end}}
diff --git a/www/about/index.html b/www/about/index.html
index 435ff2a..b85f9f3 100644
--- a/www/about/index.html
+++ b/www/about/index.html
@@ -43,15 +43,11 @@ <h2>No really</h2>
}
</style>
-
-
-
<footer>
© 2022–2023 Coolio McCool<br>
Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>
</footer>
-
</body>
</html>
diff --git a/www/hello/index.html b/www/hello/index.html
index c47619d..6ff14fc 100644
--- a/www/hello/index.html
+++ b/www/hello/index.html
@@ -14,7 +14,6 @@
<nav>
<a href="/">Home</a>
<a href="/about/index.html">About</a>
-
<span class="posted-on">
Posted on
<time datetime="2022-01-02">
@@ -42,15 +41,11 @@ <h1 class="post-title">Hello</h1>
}
</style>
-
-
-
<footer>
© 2022–2023 Coolio McCool<br>
Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>
</footer>
-
</body>
</html>
diff --git a/www/index.html b/www/index.html
index 938a3bb..add5104 100644
--- a/www/index.html
+++ b/www/index.html
@@ -20,9 +20,7 @@ <h1 class="site-title">CoolZone</h1>
<div class="pages">
<a href="/">Home</a>
-
<a href="about/index.html">About</a>
-
<a class="feed-link" href="/feed.xml">
<img src="/_theme/feed.svg" alt="Atom Feed" title="Atom Feed">
</a>
@@ -33,21 +31,14 @@ <h1 class="site-title">CoolZone</h1>
<p>All posts, newest first:</p>
<ul>
-
-
- <li>
- 2023-04-05
- — <a href="mfws.html">This is a motherfucking website.</a>
- </li>
-
-
-
- <li>
- 2022-01-02
- — <a href="hello/index.html">Hello</a>
- </li>
-
-
+ <li>
+ 2023-04-05 —
+ <a href="mfws.html">This is a motherfucking website.</a>
+ </li>
+ <li>
+ 2022-01-02 —
+ <a href="hello/index.html">Hello</a>
+ </li>
</ul>
<style>
@@ -79,14 +70,11 @@ <h1 class="site-title">CoolZone</h1>
}
</style>
-
-
<footer>
© 2022–2023 Coolio McCool<br>
Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>
</footer>
-
</body>
</html>
diff --git a/www/mfws.html b/www/mfws.html
index 08e28ca..9ff5b9e 100644
--- a/www/mfws.html
+++ b/www/mfws.html
@@ -14,7 +14,6 @@
<nav>
<a href="/">Home</a>
<a href="/about/index.html">About</a>
-
<span class="posted-on">
Posted on
<time datetime="2023-04-05">
@@ -131,15 +130,11 @@ <h2>Epilogue</h2>
}
</style>
-
-
-
<footer>
© 2022–2023 Coolio McCool<br>
Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>
</footer>
-
</body>
</html>