aboutsummaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/404.html3
-rw-r--r--layouts/_default/baseof.html44
-rw-r--r--layouts/_default/list.html6
-rw-r--r--layouts/_default/single.html6
-rw-r--r--layouts/index.html3
-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
-rw-r--r--layouts/posts/single.html6
14 files changed, 183 insertions, 0 deletions
diff --git a/layouts/404.html b/layouts/404.html
new file mode 100644
index 0000000..23ecb19
--- /dev/null
+++ b/layouts/404.html
@@ -0,0 +1,3 @@
+{{ define "content" }}
+ {{ partial "404.html" . }}
+{{ end }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100644
index 0000000..94d09a6
--- /dev/null
+++ b/layouts/_default/baseof.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html lang="{{ .Site.LanguageCode }}">
+
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ {{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
+ {{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
+ {{ with .Site.Params.keywords }}<meta name="keywords" content="{{ . }}">{{ end }}
+
+ <base href="{{ .Site.BaseURL }}">
+ <title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
+
+ <link rel="canonical" href="{{ .Permalink }}">
+
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Fira+Mono:400,700">
+ <link rel="stylesheet" href="//cdn.rawgit.com/necolas/normalize.css/master/normalize.css">
+ <link rel="stylesheet" href="{{ "css/style.min.css" | absURL }}">
+
+ <link rel="icon" type="image/png" href="{{ "/images/favicon-32x32.png" | absURL }}" sizes="32x32">
+ <link rel="icon" type="image/png" href="{{ "/images/favicon-16x16.png" | absURL }}" sizes="16x16">
+
+ {{ if .RSSLink }}
+ <link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
+ <link href="{{ .RSSLink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />
+ {{ end }}
+
+ {{ .Hugo.Generator }}
+ </head>
+
+ <body>
+ <main class="wrapper">
+ {{ partial "header.html" . }}
+
+ <div class="content">
+ {{ block "content" . }}{{ end }}
+ </div>
+
+ {{ partial "footer.html" . }}
+ </main>
+ </body>
+
+</html>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
new file mode 100644
index 0000000..0a18678
--- /dev/null
+++ b/layouts/_default/list.html
@@ -0,0 +1,6 @@
+{{ define "title" }}
+ {{ .Title }} · {{ .Site.Title }}
+{{ end }}
+{{ define "content" }}
+ {{ partial "list.html" . }}
+{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100644
index 0000000..93ec22c
--- /dev/null
+++ b/layouts/_default/single.html
@@ -0,0 +1,6 @@
+{{ define "title" }}
+ {{ .Title }} · {{ .Site.Title }}
+{{ end }}
+{{ define "content" }}
+ {{ partial "page.html" . }}
+{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
new file mode 100644
index 0000000..b829b61
--- /dev/null
+++ b/layouts/index.html
@@ -0,0 +1,3 @@
+{{ define "content" }}
+ {{ partial "home.html" . }}
+{{ end }}
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>
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
new file mode 100644
index 0000000..75b30ed
--- /dev/null
+++ b/layouts/posts/single.html
@@ -0,0 +1,6 @@
+{{ define "title" }}
+ {{ .Title }} · {{ .Site.Title }}
+{{ end }}
+{{ define "content" }}
+ {{ partial "post.html" . }}
+{{ end }}