aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/partials
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/404.html7
-rw-r--r--layouts/partials/footer.html5
-rw-r--r--layouts/partials/header.html14
-rw-r--r--layouts/partials/home.html11
-rw-r--r--layouts/partials/list.html11
-rw-r--r--layouts/partials/page.html9
-rw-r--r--layouts/partials/pagination.html48
-rw-r--r--layouts/partials/post.html10
8 files changed, 115 insertions, 0 deletions
diff --git a/layouts/partials/404.html b/layouts/partials/404.html
new file mode 100644
index 0000000..7df669c
--- /dev/null
+++ b/layouts/partials/404.html
@@ -0,0 +1,7 @@
+<section class="container centered">
+ <div class="error">
+ <h1>404</h1>
+ <h2>Page Not Found</h2>
+ <p>Sorry, this page does not exist.<br />You can head back to <a href="{{ .Site.BaseURL }}">homepage</a>.</p>
+ </div>
+</section>
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
new file mode 100644
index 0000000..f674f1d
--- /dev/null
+++ b/layouts/partials/footer.html
@@ -0,0 +1,5 @@
+<footer class="footer">
+ <section class="container">
+ © {{ .Site.LastChange.Format "2006" }} · Powered by <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.
+ </section>
+</footer>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
new file mode 100644
index 0000000..caa698f
--- /dev/null
+++ b/layouts/partials/header.html
@@ -0,0 +1,14 @@
+<nav class="navigation">
+ <section class="container">
+ <a class="navigation-title" href="{{ "/" | absURL }}">
+ {{ .Site.Title }}
+ </a>
+ <ul class="navigation-list float-right">
+ {{ range sort .Site.Menus.main }}
+ <li class="navigation-item">
+ <a class="navigation-link" href="{{ .URL }}">{{ .Name }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ </section>
+</nav>
diff --git a/layouts/partials/home.html b/layouts/partials/home.html
new file mode 100644
index 0000000..6c44ae0
--- /dev/null
+++ b/layouts/partials/home.html
@@ -0,0 +1,11 @@
+<section class="container centered">
+ <div class="about">
+ <h1>{{ .Site.Params.author }}</h1>
+ <h2>{{ .Site.Params.info }}</h2>
+ <ul>
+ {{ range sort .Site.Params.social }}
+ <li><a href="{{ .url }}">{{ .name }}</a></li>
+ {{ end }}
+ </ul>
+ </div>
+</section>
diff --git a/layouts/partials/list.html b/layouts/partials/list.html
new file mode 100644
index 0000000..f62516b
--- /dev/null
+++ b/layouts/partials/list.html
@@ -0,0 +1,11 @@
+<section class="container list">
+ <h1 class="title">{{ .Title }}</h1>
+ <ul>
+ {{ range .Paginator.Pages }}
+ <li>
+ <span>{{ .Date.Format "January 2, 2006" }}</span><a href="{{ .URL }}">{{ .Title }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ {{ partial "pagination.html" . }}
+</section>
diff --git a/layouts/partials/page.html b/layouts/partials/page.html
new file mode 100644
index 0000000..d39a27e
--- /dev/null
+++ b/layouts/partials/page.html
@@ -0,0 +1,9 @@
+<section class="container page">
+ <article>
+ <header>
+ <h1>{{ .Title }}</h1>
+ </header>
+
+ {{ .Content }}
+ </article>
+</section>
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html
new file mode 100644
index 0000000..1e004b8
--- /dev/null
+++ b/layouts/partials/pagination.html
@@ -0,0 +1,48 @@
+{{ $paginator := .Paginator }}
+{{ $adjacent_links := 2 }}
+{{ $max_links := (add (mul $adjacent_links 2) 1) }}
+{{ $lower_limit := (add $adjacent_links 1) }}
+{{ $upper_limit := (sub $paginator.TotalPages $adjacent_links) }}
+{{ if gt $paginator.TotalPages 1 }}
+<ul class="pagination">
+ {{ if $paginator.HasPrev }}
+ {{ if ne $paginator.PageNumber 1 }}
+ <li><a href="{{ $paginator.First.URL }}">&laquo;</a></li>
+ {{ end }}
+ <li class="hidden"><a href="{{ $paginator.Prev.URL }}">&lsaquo;</a></li>
+ {{ end }}
+ {{ range $paginator.Pagers }}
+ {{ $.Scratch.Set "page_number_flag" false }}
+ {{ if gt $paginator.TotalPages $max_links }}
+ {{ if le $paginator.PageNumber $lower_limit }}
+ {{ if le .PageNumber $max_links }}
+ {{ $.Scratch.Set "page_number_flag" true }}
+ {{ end }}
+ {{ else if ge $paginator.PageNumber $upper_limit }}
+ {{ if gt .PageNumber (sub $paginator.TotalPages $max_links) }}
+ {{ $.Scratch.Set "page_number_flag" true }}
+ {{ end }}
+ {{ else }}
+ {{ if and ( ge .PageNumber (sub $paginator.PageNumber $adjacent_links) ) ( le .PageNumber (add $paginator.PageNumber $adjacent_links) ) }}
+ {{ $.Scratch.Set "page_number_flag" true }}
+ {{ end }}
+ {{ end }}
+ {{ else }}
+ {{ $.Scratch.Set "page_number_flag" true }}
+ {{ end }}
+ {{ if eq ($.Scratch.Get "page_number_flag") true }}
+ {{ if eq . $paginator }}
+ <li>{{ .PageNumber }}</li>
+ {{ else }}
+ <li><a href="{{ .URL }}">{{ .PageNumber }}</a></li>
+ {{ end }}
+ {{ end }}
+ {{ end }}
+ {{ if $paginator.HasNext }}
+ <li class="hidden"><a href="{{ $paginator.Next.URL }}">&rsaquo;</a></li>
+ {{ if ne $paginator.PageNumber $paginator.TotalPages }}
+ <li><a href="{{ $paginator.Last.URL }}">&raquo;</a></li>
+ {{ end }}
+ {{ end }}
+</ul>
+{{ end }}
diff --git a/layouts/partials/post.html b/layouts/partials/post.html
new file mode 100644
index 0000000..5e8e4dd
--- /dev/null
+++ b/layouts/partials/post.html
@@ -0,0 +1,10 @@
+<section class="container post">
+ <article>
+ <header>
+ <h1 class="title">{{ .Title }}</h1>
+ <h2 class="date">{{ .Date.Format "January 2, 2006" }}</h2>
+ </header>
+
+ {{ .Content }}
+ </article>
+</section>