summaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
authorShubham Saini <me@ubh.sh>2023-02-09 00:19:28 +0000
committerShubham Saini <me@ubh.sh>2023-02-09 00:19:28 +0000
commitd7da16ecfa5cadb643df78694db44963ba665cbe (patch)
tree00c5234f542f7064e91827064767bcf59f094a2c /layouts/_default
init
Diffstat (limited to 'layouts/_default')
-rwxr-xr-xlayouts/_default/baseof.html11
-rwxr-xr-xlayouts/_default/list.html17
-rwxr-xr-xlayouts/_default/single.html33
-rwxr-xr-xlayouts/_default/term.html15
-rwxr-xr-xlayouts/_default/terms.html20
5 files changed, 96 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100755
index 0000000..b941097
--- /dev/null
+++ b/layouts/_default/baseof.html
@@ -0,0 +1,11 @@
1<!DOCTYPE html>
2<html>
3 {{- partial "header.html" . -}}
4 <body>
5 <div class="content">
6 {{- partial "head.html" . -}}
7 {{- block "main" . }}{{- end }}
8 {{- partial "footer.html" . -}}
9 </div>
10 </body>
11</html>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
new file mode 100755
index 0000000..41a4c6f
--- /dev/null
+++ b/layouts/_default/list.html
@@ -0,0 +1,17 @@
1{{ define "main" }}
2{{ if isset .Data "Term" }}
3<h1>Entries tagged - "{{ .Data.Term }}"</h1>
4{{ else }}
5<h1 class="page-title">All articles</h1>
6{{ end }}
7
8<ul class="posts">
9 {{- range .Data.Pages -}}
10 {{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}}
11 <li class="post">
12 <a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
13 </li>
14 {{- end -}}
15 {{- end -}}
16</ul>
17{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100755
index 0000000..44222d4
--- /dev/null
+++ b/layouts/_default/single.html
@@ -0,0 +1,33 @@
1{{ define "main" }}
2<main>
3 <article>
4 <div class="title">
5 <h1 class="title">{{ .Title }}</h1>
6 {{ if .Date }}<div class="meta">Posted on {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div> {{ end }}
7 </div>
8 {{ if isset .Params "tldr" }}
9 <div class="tldr">
10 <strong>tl;dr:</strong>
11 {{ .Params.tldr }}
12 </div>{{ end }}
13
14 <section class="body">
15 {{ .Content }}
16 </section>
17
18 <div class="post-tags">
19 {{ if ne .Type "page" }}
20 {{ if gt .Params.tags 0 }}
21 <nav class="nav tags">
22 <ul class="tags">
23 {{ range .Params.tags }}
24 <li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
25 {{ end }}
26 </ul>
27 </nav>
28 {{ end }}
29 {{ end }}
30 </div>
31 </article>
32</main>
33{{ end }}
diff --git a/layouts/_default/term.html b/layouts/_default/term.html
new file mode 100755
index 0000000..9648bf3
--- /dev/null
+++ b/layouts/_default/term.html
@@ -0,0 +1,15 @@
1<!DOCTYPE html>
2<html>
3{{ partial "header.html" . }}
4
5<body>
6 <div class="container wrapper tags">
7 {{ partial "head.html" . }}
8
9 <h1 class="page-title">All tags</h1>
10 </div>
11
12 {{ partial "footer.html" . }}
13</body>
14
15</html> \ No newline at end of file
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
new file mode 100755
index 0000000..fea9c2f
--- /dev/null
+++ b/layouts/_default/terms.html
@@ -0,0 +1,20 @@
1{{ define "main" }}
2<h1 class="page-title">All tags</h1>
3
4{{ $biggest := 1 }}
5{{ $smallest := 1 }}
6{{ $max := 3 }}
7{{ $min := 1 }}
8{{ $size := $min }}
9
10{{ $data := .Data }}
11<div class="tag-cloud">
12 <ul class="tags">
13 {{ range $key, $value := .Data.Terms.ByCount }}
14 {{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }}
15 {{ $size := (cond (eq $biggest $smallest) $min $size) }}
16 <li><a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a></li>
17 {{ end }}
18 </ul>
19</div>
20{{ end }}