Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/darshanbaral/kitab.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarshan Baral <darshanbaral@gmail.com>2019-06-08 21:35:33 +0300
committerDarshan Baral <darshanbaral@gmail.com>2019-06-08 21:35:33 +0300
commitd88d35a36bfafec5e4202bafdb7acf6606e4918b (patch)
tree84291bfdc1d7d4ef4084e9f3754270176ed32c0a /layouts
parent8d3f569ec454f44a1491fb4d7e47be30f9b15c09 (diff)
Added book covers. Style changes for nav buttons
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/section.html51
-rw-r--r--layouts/_default/single.html41
-rw-r--r--layouts/index.html12
-rw-r--r--layouts/partials/head.html3
-rw-r--r--layouts/partials/nextChapter.html6
-rw-r--r--layouts/partials/previousChapter.html6
6 files changed, 73 insertions, 46 deletions
diff --git a/layouts/_default/section.html b/layouts/_default/section.html
index d954777..53ce523 100644
--- a/layouts/_default/section.html
+++ b/layouts/_default/section.html
@@ -1,32 +1,59 @@
{{ define "main" }}
<div class="row mb-4">
+ {{ $flag := or (ne (string .Params.bookCover) "") (ne (string .Params.bookCoverSmall) "") }}
+ {{ if $flag }}
<div class="col-md-6">
<div class="w-90 m-auto bg-warning">
- {{ $path := (print "bookCovers/" (replace .Dir "\\" "") ".jpg") | relURL }}
- <img class="rounded shadow-lg" style="width: 100%;" src="{{ $path }}" />
+ {{ if (and .Params.bookCover .Params.bookCoverSmall) }}
+ <a href="{{ .Params.bookCover | relURL }}"
+ ><img
+ class="rounded"
+ style="width: 100%;"
+ src="{{ .Params.bookCoverSmall | relURL }}"
+ /></a>
+ {{ else if .Params.bookCover }}
+ <img
+ class="rounded"
+ style="width: 100%;"
+ src="{{ .Params.bookCover | relURL }}"
+ />
+ {{ end }}
<div class="bookTitle p-0 rounded" style="width: 60%;">
<h2 class="book-cover m-0 pl-1 pr-1">{{ .Title | markdownify }}</h2>
- <h4 class="book-cover pl-1 pr-1 w-auto">Sub-title</h4>
+ {{ if .Params.subtitle }}
+ <h4 class="book-cover pl-1 pr-1 w-auto">
+ {{- .Params.subtitle -}}
+ </h4>
+ {{ end }}
</div>
<div class="bookAuthor p-0 rounded">
<h4 class="book-cover m-0 pl-1 pr-1">{{ .Params.author }}</h4>
</div>
</div>
</div>
+ {{ end }}
- <div class="col-md-6 p-2 rounded shadow">
+ <div class="{{ cond $flag "col-md-6" "col-md-12" }} p-2 rounded shadow">
+ {{ if not $flag }}
+ <h2>{{ .Title | markdownify }}</h2>
+ {{ if .Params.subtitle }}
+ <h4>{{ .Params.subtitle }}</h4>
+ {{ end }}
+ <h5>by {{ .Params.author }}</h5>
+ <hr>
+ {{ end }}
<h3>
Chapters
</h3>
<ul class="list-unstyled">
- {{ range.Pages.ByWeight }}
- <li>
- <a href="{{ .Permalink }}">
- {{ .Title }}
- </a>
- </li>
- {{ end }}
- </ul>
+ {{ range .Pages.ByWeight }}
+ <li>
+ <a href="{{ .Permalink }}">
+ {{ .Title }}
+ </a>
+ </li>
+ {{ end }}
+ </ul>
</div>
</div>
{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 8a26312..16f2213 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,31 +1,28 @@
{{ define "main" }}
-<div class="mb-4">
- <small>{{ partial "previousChapter" . }}</small>
+<div class="mb-2">
<h2>{{ .Title }}</h2>
- <div class="ml-4 border-left border-primary pl-1">
+ <div class="rounded p-2 shadow" style="margin-left: 32px;">
{{ .Content }}
- <div
- class="d-flex flex-row justify-content-around border-top pt-2 border-primary"
- >
- {{ partial "previousChapter" . }}
- {{ partial "nextChapter" . }}
- </div>
</div>
- <div class="toTop" style="width: 50px;">
- <p class="navMenu menuItem mb-0">
- <i class="fas fa-angle-up" onclick="scrollToTop()"></i>
+ <div class="toTop" style="width: 25px;">
+ {{ partial "previousChapter" . }}
+ {{ partial "nextChapter" . }}
+ <p class="navMenu menuItem mb-1 mt-1 text-left">
+ <i
+ class="fas fa-chevron-circle-up"
+ title="Scroll to top"
+ onclick="scrollToTop()"
+ ></i>
</p>
- <hr>
- <p class="about text-right">
- <small>
- <a href="https://github.com/darshanbaral/kitab">
- kitab<br>
- </a>
- <a href="https://www.darshanbaral.com/">
- d.b
- </a>
- </small>
+ <p class="about text-left mb-0">
+ <a href="https://github.com/darshanbaral/kitab">
+ <small class="text-secondary">kitab</small>
+ <br />
+ </a>
+ <a href="https://www.darshanbaral.com/">
+ <small class="text-secondary">d.b</small>
+ </a>
</p>
</div>
</div>
diff --git a/layouts/index.html b/layouts/index.html
index 94cb137..517b9d3 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,16 +1,16 @@
{{ define "main" }}
<div class="site-title text-center">
<h1>
- {{ .Title }}
+ {{- .Title -}}
</h1>
</div>
<div class="d-flex flex-row justify-content-center row">
{{ range .Site.Sections.ByWeight }}
- <div class="m-2 p-2 border border-primary rounded" style="min-width: 300px; width: 40%;">
+ <div class="m-4 p-4 shadow rounded" style="min-width: 300px; width: 40%;">
<a href="{{ .Permalink }}">
- <h3 class="mb-0 p-0">
+ <h4 class="mb-0 p-0">
{{ .Title | markdownify }}
- </h3>
+ </h4>
</a>
<div class="text-right">
<small>
@@ -21,9 +21,9 @@
{{ range first 5 .Pages }}
<li>
<a href="{{ .Permalink }}">
- <h4>
+ <p class="mb-1">
{{ .Title }}
- </h4>
+ </p>
</a>
</li>
{{ end }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 6905cf6..3dbc754 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -8,6 +8,9 @@
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
+ {{- $hugoGenerator := index (findRE `content=\"(.+)\"` hugo.Generator) 0 }}
+ <meta name="generator" content="kitab theme by Darshan in {{ replaceRE `content=|\"` `` $hugoGenerator }}" />
+
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
diff --git a/layouts/partials/nextChapter.html b/layouts/partials/nextChapter.html
index 9d1d588..59767e6 100644
--- a/layouts/partials/nextChapter.html
+++ b/layouts/partials/nextChapter.html
@@ -1,10 +1,10 @@
{{ if .PrevInSection }}
-<div>
+<p class="navMenu menuItem mb-1 mt-1 text-left">
<a
href="{{ .PrevInSection.Permalink | relURL }}"
title="{{ .PrevInSection.Title }}"
>
- Next Chapter &gt;
+ <i class="fas fa-chevron-circle-right"></i>
</a>
-</div>
+</p>
{{ end }}
diff --git a/layouts/partials/previousChapter.html b/layouts/partials/previousChapter.html
index de0e7ec..5297da2 100644
--- a/layouts/partials/previousChapter.html
+++ b/layouts/partials/previousChapter.html
@@ -1,10 +1,10 @@
{{ if .NextInSection }}
-<div>
+<p class="navMenu menuItem mb-1 mt-1 text-left">
<a
href="{{ .NextInSection.Permalink | relURL }}"
title="{{ .NextInSection.Title }}"
>
- &lt; Previous Chapter
+ <i class="fas fa-chevron-circle-left"></i>
</a>
-</div>
+</p>
{{ end }}