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

github.com/jacobsun/hugo-theme-cole.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsun6eal <jacob.sun.meta@gmail.com>2019-05-25 16:23:25 +0300
committersun6eal <jacob.sun.meta@gmail.com>2019-05-25 16:23:25 +0300
commitdeb0187d683cfbf69384650ec3bff09609fd9091 (patch)
treea14fcfa503d0cc23f8aeed915ec69de2e9b0127c /layouts
parent1ba844741108bd7e1dcd67b31561a5747b5ca47a (diff)
update
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/list.html9
-rw-r--r--layouts/_default/single.html9
-rw-r--r--layouts/index.html9
-rw-r--r--layouts/partials/_single.html36
-rw-r--r--layouts/partials/comment.html23
-rw-r--r--layouts/partials/footer.html1
-rw-r--r--layouts/partials/head.html24
-rw-r--r--layouts/partials/header.html14
-rw-r--r--layouts/partials/js.html9
-rw-r--r--layouts/partials/list.html10
-rw-r--r--layouts/partials/pagination.html19
11 files changed, 163 insertions, 0 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
new file mode 100644
index 0000000..85538ac
--- /dev/null
+++ b/layouts/_default/list.html
@@ -0,0 +1,9 @@
+{{ partial "head.html" . }}
+
+<body>
+ {{ partial "header.html" . }}
+ {{ partial "list.html" . }}
+ {{ partial "js.html" . }}
+ {{ partial "footer.html" .}}
+</body>
+</html>
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100644
index 0000000..0f588fb
--- /dev/null
+++ b/layouts/_default/single.html
@@ -0,0 +1,9 @@
+{{ partial "head.html" . }}
+
+<body>
+ {{ partial "header.html" . }}
+ {{ partial "_single.html" . }}
+ {{ partial "js.html" . }}
+ {{ partial "footer.html" .}}
+</body>
+</html>
diff --git a/layouts/index.html b/layouts/index.html
new file mode 100644
index 0000000..85538ac
--- /dev/null
+++ b/layouts/index.html
@@ -0,0 +1,9 @@
+{{ partial "head.html" . }}
+
+<body>
+ {{ partial "header.html" . }}
+ {{ partial "list.html" . }}
+ {{ partial "js.html" . }}
+ {{ partial "footer.html" .}}
+</body>
+</html>
diff --git a/layouts/partials/_single.html b/layouts/partials/_single.html
new file mode 100644
index 0000000..550ea05
--- /dev/null
+++ b/layouts/partials/_single.html
@@ -0,0 +1,36 @@
+<main class="content">
+ <h1 class="title"><a href='{{ .RelPermalink }}' class="btn">{{ .Title }}</a></h1>
+ <div class="content">
+ {{ if .Content }}
+ {{ .Content }}
+ {{ else }}
+ <p class="no-content">No content.</p>
+ {{ end }}
+ </div>
+ <div class="meta">
+ <p class="published-date">
+ Published at: <time datetime="{{ .Date.Format "2006.01.02" }}">{{ .Date.Format "2006.01.02" }}</time>
+ </p>
+ {{ with .Params.categories }}
+ <p>Categories</p>
+ <ul class="categories control">
+ {{ range . }}
+ <li>
+ <a href="{{ "categories" | absURL }}/{{ . | urlize }}/" class="btn">{{ . }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ {{ end }}
+ {{ with .Params.tags }}
+ <p>Tags:</p>
+ <ul class="tags control">
+ {{ range . }}
+ <li>
+ <a href="{{ "tags" | absURL }}/{{ . | urlize }}/" class="btn">{{ . }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ {{ end }}
+ </div>
+</main>
+{{ partial "comment.html" . }}
diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html
new file mode 100644
index 0000000..c9c4bb1
--- /dev/null
+++ b/layouts/partials/comment.html
@@ -0,0 +1,23 @@
+<section class="comment">
+ <p class="local-info">
+ Comment is disabled to avoid unwanted discussions from 'localhost:1313' on your Disqus
+ account...
+ </p>
+ <div id="disqus_thread"></div>
+</section>
+<script type="text/javascript">
+
+ (function () {
+ if (window.location.hostname == "localhost") {
+ return
+ }
+ document.querySelector('.local-info').classList.add('hide')
+
+ let dsq = document.createElement('script')
+ dsq.type = 'text/javascript'
+ dsq.async = true
+ let disqus_shortname = '{{ .Site.DisqusShortname }}'
+ dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq)
+ })()
+</script>
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
new file mode 100644
index 0000000..c6c93cc
--- /dev/null
+++ b/layouts/partials/footer.html
@@ -0,0 +1 @@
+<footer class="footer">{{ .Site.Params.footer | safeHTML }}</footer>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
new file mode 100644
index 0000000..759f408
--- /dev/null
+++ b/layouts/partials/head.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html {{ with .Site.LanguageCode }}lang="{{ . }}" {{ end }}>
+
+<head>
+ <meta charset="utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ {{ $.Hugo.Generator }}
+ <!-- Permalink & RSSlink -->
+ <link rel="canonical" href="{{ .Permalink }}" />
+ <meta name="description" content="{{ .Site.Params.Description }}">
+ {{ range .AlternativeOutputFormats }}
+ <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
+ {{ end }}
+ <title>{{ if .IsHome }}{{ .Title }}{{ else }}{{ .Title }} &middot; {{ .Site.Title }}{{ end }}</title>
+ <link rel="shortcut icon" href="{{ "images/favicon.ico" | absURL }}" />
+ <link rel="stylesheet" href="{{ "css/main.css" | absURL }}" />
+ <link rel="stylesheet"
+ href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/atom-one-light.min.css">
+ <!-- custom css -->
+ {{ range .Site.Params.customCSS }}
+ <link rel="stylesheet" href="{{ "css/" | absURL }}{{ . }}">
+ {{ end }}
+</head>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
new file mode 100644
index 0000000..fed4f85
--- /dev/null
+++ b/layouts/partials/header.html
@@ -0,0 +1,14 @@
+<header class="header">
+ <a href="{{ .Site.BaseURL }}" class="btn logo-link">
+ <img class="logo" src="{{ "images/logo.svg" | absURL }}" alt="logo" />
+ </a>
+ <ul class="control menu">
+ {{ range .Site.Menus.main }}
+ <li>
+ <a href="{{ .URL }}" class="btn">
+ {{ .Name }}
+ </a>
+ </li>
+ {{ end }}
+ </ul>
+</header>
diff --git a/layouts/partials/js.html b/layouts/partials/js.html
new file mode 100644
index 0000000..a30927b
--- /dev/null
+++ b/layouts/partials/js.html
@@ -0,0 +1,9 @@
+<script src="{{ "js/main.js" | absURL }}"></script>
+{{ range .Site.Params.customJs}}
+ <script src="{{ "js/" | absURL }}{{ . }}"></script>
+{{ end }}
+<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js"></script>
+<script>hljs.initHighlightingOnLoad();</script>
+{{- if not .Site.IsServer -}}
+{{ template "_internal/google_analytics_async.html" . }}
+{{- end -}}
diff --git a/layouts/partials/list.html b/layouts/partials/list.html
new file mode 100644
index 0000000..28674f3
--- /dev/null
+++ b/layouts/partials/list.html
@@ -0,0 +1,10 @@
+<ul class="list control">
+{{ $paginator := .Paginate (where .Pages "Params.hidden" "!=" true) }}
+{{ range $paginator.Pages }}
+ <li class="item">
+ <span class="date">{{ .PublishDate.Format "01-02" }}</span>
+ <a class="btn" href="{{ .Permalink }}"> {{ .Title }} </a>
+ </li>
+{{ end }}
+</ul>
+{{ partial "pagination.html" .}}
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html
new file mode 100644
index 0000000..481321a
--- /dev/null
+++ b/layouts/partials/pagination.html
@@ -0,0 +1,19 @@
+<div class="pagination">
+ <ul class="control">
+ {{ if .Paginator.HasPrev }}
+ <li class="left">
+ <a href="{{ .Paginator.Prev.URL }}" class="prev btn">
+ 🢨
+ </a>
+ </li>
+ {{ end }}
+
+ {{ if .Paginator.HasNext }}
+ <li class="right">
+ <a href="{{ .Paginator.Next.URL }}" class="next btn">
+ 🢩
+ </a>
+ </li>
+ {{ end }}
+ </ul>
+</div>