about summary refs log tree commit diff
path: root/layouts
diff options
context:
space:
mode:
authorNgô Ngọc Đức Huy <huyngo@disroot.org>2021-08-16 10:28:54 +0700
committerNgô Ngọc Đức Huy <huyngo@disroot.org>2021-08-16 11:20:29 +0700
commit75d5209e5c9dc8c9c22a5a865f7c7f8166b282e6 (patch)
tree9a6c40403a91536dc05fd38ff0b894164eb50c11 /layouts
parent4f02b06ad5e9a4e60f07afc08551bf4c611547af (diff)
downloadblog-75d5209e5c9dc8c9c22a5a865f7c7f8166b282e6.tar.gz
Switch data representation to definition list
Thank the author of the blog post [1] that helped me writing the CSS

[1]: https://www.the-art-of-web.com/css/format-dl/
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/books.html46
-rw-r--r--layouts/_default/comic.html42
-rw-r--r--layouts/_default/single.html6
3 files changed, 67 insertions, 27 deletions
diff --git a/layouts/_default/books.html b/layouts/_default/books.html
new file mode 100644
index 0000000..c4b7589
--- /dev/null
+++ b/layouts/_default/books.html
@@ -0,0 +1,46 @@
+{{ define "main" }}
+{{ if .Menus }}
+<nav class="post-navigation">
+  {{ range .Menus }}
+  <a href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
+  {{ end }}
+</nav>
+{{ end }}
+
+<article class="post h-entry">
+  <header class="post-header">
+    <h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}">{{ trim .Title  " " }}</h1>
+  </header>
+  <div class="content e-content">
+    <h1>Book info</h1>
+    <dl class="book-data">
+      <dt>Book</dt>
+      <dd>{{ .Params.book }}</dd>
+      <dt>Authors</dt>
+      {{ range $author := .Params.authors }}
+        <dd>{{ $author }}</dd>
+      {{ end }}
+      <dt>ISBN</dt>
+      <dd>{{ .Params.isbn }}</dd>
+      <dt>Genres</dt>
+      {{ range $genre := .Params.genres }}
+        <dd>{{ $genre }}</dd>
+      {{ end }}
+      <dt>Language</dt>
+      <dd>{{ .Language.LanguageName }}</dd>
+    </dl>
+    {{ .Content }}
+    <hr>
+    {{ i18n "BookShare" }}
+  </div>
+  {{ partial "postInfo.html" . }}
+</article>
+
+{{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }}
+  {{ partial "paginationPost.html" . }}
+{{ end }}
+
+
+{{ partial "custom-webring.html" }}
+
+{{ end }}
diff --git a/layouts/_default/comic.html b/layouts/_default/comic.html
index 1b3e33e..2758deb 100644
--- a/layouts/_default/comic.html
+++ b/layouts/_default/comic.html
@@ -1,34 +1,34 @@
 {{ define "main" }}
 {{ if .Menus }}
 <nav class="post-navigation">
-	{{ range .Menus }}
-	<a href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
-	{{ end }}
+  {{ range .Menus }}
+  <a href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
+  {{ end }}
 </nav>
 {{ end }}
 
 <article class="post h-entry">
-	<header class="post-header">
-		<center>
-			<h1 class="p-name post-title{{ if .Params.draft }} draft{{end}}">{{ trim .Title  " " }}</h1>
-		{{ if in .Params.categories "comics" }}
-		</center>
-		{{ end}}
-	</header>
-	<div class="content e-content">
-		<center>
-		{{ partial "comicNav.html" . }}
-		<img title="{{ .Params.TitleText }}" alt="{{ .Params.Alt}}"
-			src={{ .Params.ComicLink}}>
-		{{ partial "comicNav.html" . }}
-		{{ .Content }}
-		<center>
-	</div>
-	{{ partial "postInfo.html" . }}
+  <header class="post-header">
+    <center>
+      <h1 class="p-name post-title{{ if .Params.draft }} draft{{end}}">{{ trim .Title  " " }}</h1>
+    {{ if in .Params.categories "comics" }}
+    </center>
+    {{ end}}
+  </header>
+  <div class="content e-content">
+    <center>
+    {{ partial "comicNav.html" . }}
+    <img title="{{ .Params.TitleText }}" alt="{{ .Params.Alt}}"
+      src={{ .Params.ComicLink}}>
+    {{ partial "comicNav.html" . }}
+    {{ .Content }}
+    <center>
+  </div>
+  {{ partial "postInfo.html" . }}
 </article>
 
 {{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }}
-	{{ partial "paginationPost.html" . }}
+  {{ partial "paginationPost.html" . }}
 {{ end }}
 
 
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index c2ef2cf..7ba428d 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -12,13 +12,7 @@
 		<h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}">{{ trim .Title  " " }}</h1>
 	</header>
 	<div class="content e-content">
-		<!-- normal content -->
 		{{ .Content }}
-		<!-- book reviews -->
-		{{ if in .Params.categories "book review" }}
-		<hr>
-		{{ i18n "BookShare" }}
-		{{ end }}
 	</div>
 	{{ partial "postInfo.html" . }}
 </article>