summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html14
-rw-r--r--layouts/_default/list.html14
-rw-r--r--layouts/_default/single.html24
-rw-r--r--layouts/index.html36
-rw-r--r--layouts/partials/favicon.html1
-rw-r--r--layouts/partials/footer.html9
-rw-r--r--layouts/partials/head.html23
-rw-r--r--layouts/partials/header.html9
-rw-r--r--layouts/partials/math.html5
-rw-r--r--layouts/partials/post-meta.html12
-rw-r--r--layouts/partials/scripts.html5
-rw-r--r--layouts/partials/sidebar.html37
-rw-r--r--layouts/tags/list.html42
13 files changed, 231 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100644
index 0000000..13f61d2
--- /dev/null
+++ b/layouts/_default/baseof.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="{{ .Site.LanguageCode }}">
+{{ partial "head.html" . }}
+
+<body class="d-flex flex-column h-100">
+ {{ partial "header.html" . }}
+
+ {{ block "main" . }}{{ end }}
+
+ {{ partial "footer.html" . }}
+ {{ partial "scripts.html" . }}
+</body>
+
+</html> \ No newline at end of file
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
new file mode 100644
index 0000000..0275644
--- /dev/null
+++ b/layouts/_default/list.html
@@ -0,0 +1,14 @@
+{{ define "main" }}
+<main>
+ <div class="container-md clearfix">
+ <!-- list -->
+ <div class="col-md-9 col-12 float-left" id="content">
+ <span id="not-found">404 NOT FOUND</span>
+ </div>
+ <!-- sidebar -->
+ <div class="col-md-3 col-12 float-left" id="sidebar">
+ {{ partial "sidebar.html" . }}
+ </div>
+ </div>
+</main>
+{{ end }} \ No newline at end of file
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100644
index 0000000..9da2c59
--- /dev/null
+++ b/layouts/_default/single.html
@@ -0,0 +1,24 @@
+{{ define "main" }}
+<main>
+ <div class="container-md clearfix">
+ <!-- list -->
+ <div class="col-md-9 col-12 float-left" id="content">
+ <article>
+ <h4 id="post-title">
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ </h4>
+ <div id="post-meta">
+ {{ partial "post-meta.html" . }}
+ </div>
+ <div class="markdown-body" id="post-content">
+ {{ .Content }}
+ </div>
+ </article>
+ </div>
+ <!-- sidebar -->
+ <div class="col-md-3 col-12 float-left" id="sidebar">
+ {{ partial "sidebar.html" . }}
+ </div>
+ </div>
+</main>
+{{ end }} \ No newline at end of file
diff --git a/layouts/index.html b/layouts/index.html
new file mode 100644
index 0000000..0373851
--- /dev/null
+++ b/layouts/index.html
@@ -0,0 +1,36 @@
+{{ define "main" }}
+<main>
+ <div class="container-md clearfix">
+ <!-- list -->
+ <div class="col-md-9 col-12 float-left" id="content">
+ <!-- homepage range in posts -->
+ {{ $paginator := .Paginate (where .Site.RegularPages "Type" "post") }}
+ {{ range $paginator.Pages }}
+ <div id="post">
+ <h2 id="post-title">
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ </h2>
+ <div id="post-meta">
+ {{ partial "post-meta.html" . }}
+ </div>
+ <div id="post-summary">
+ {{ .Summary }}
+ </div>
+ <div id="post-exlink">
+ <a href="{{ .Permalink }}#">&gt; READ MORE ...</a>
+ </div>
+ </div>
+ {{ end }}
+ {{ if gt $paginator.TotalPages 1 }}
+ <div id="pagination">
+ {{ template "_internal/pagination.html" . }}
+ </div>
+ {{ end }}
+ </div>
+ <!-- sidebar -->
+ <div class="col-md-3 col-12 float-left" id="sidebar">
+ {{ partial "sidebar.html" . }}
+ </div>
+ </div>
+</main>
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/favicon.html b/layouts/partials/favicon.html
new file mode 100644
index 0000000..c152663
--- /dev/null
+++ b/layouts/partials/favicon.html
@@ -0,0 +1 @@
+<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/amzrk2/poal-jsdelivr/amzrk2/favicons/favicon.ico"> \ No newline at end of file
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
new file mode 100644
index 0000000..a5317e1
--- /dev/null
+++ b/layouts/partials/footer.html
@@ -0,0 +1,9 @@
+<footer>
+ <div class="container-md text-center">
+ <p>
+ &copy; {{ now.Format "2006" }} <a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a> |
+ Powered by <a href="https://gohugo.io/" target="_blank">Hugo {{ hugo.Version }}</a>
+ & <a href="https://github.com/amzrk2/hugo-theme-fuji/" target="_blank">Fuji</a>
+ </p>
+ </div>
+</footer> \ No newline at end of file
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
new file mode 100644
index 0000000..8d035ce
--- /dev/null
+++ b/layouts/partials/head.html
@@ -0,0 +1,23 @@
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+<meta name="HandheldFriendly" content="True" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge" />
+<meta http-equiv="Cache-Control" content="no-transform">
+<meta http-equiv="Cache-Control" content="no-siteapp">
+{{ hugo.Generator }}
+{{ partial "favicon.html" . }}
+
+{{ if .IsHome }}
+<title>{{ .Site.Title }} - {{ .Site.Params.subTitle }}</title>
+{{ else }}
+<title>{{ .Title }} - {{ .Site.Title }}</title>
+{{ end }}
+
+{{ $sass := resources.Get "sass/main.scss" }}
+{{ $style := $sass | resources.ToCSS }}
+<link rel="stylesheet" href="{{ $style.Permalink }}">
+<script src="{{ .Site.Params.cdnVanillaLazyloadJS }}"></script>
+
+{{ if or .Params.math .Site.Params.math }}
+{{ partial "math.html" . }}
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
new file mode 100644
index 0000000..7f3a254
--- /dev/null
+++ b/layouts/partials/header.html
@@ -0,0 +1,9 @@
+<header>
+ <!-- fake navbar header-->
+ <div class="container-md clearfix">
+ <div class="col-12 p-3">
+ <a id="main-title" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
+ <span id="sub-title">{{ .Site.Params.subTitle }}</span>
+ </div>
+ </div>
+</header> \ No newline at end of file
diff --git a/layouts/partials/math.html b/layouts/partials/math.html
new file mode 100644
index 0000000..621a2c8
--- /dev/null
+++ b/layouts/partials/math.html
@@ -0,0 +1,5 @@
+<!-- https://katex.org/docs/autorender.html -->
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
+<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
+<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI"
+ crossorigin="anonymous" onload="renderMathInElement(document.body);"></script> \ No newline at end of file
diff --git a/layouts/partials/post-meta.html b/layouts/partials/post-meta.html
new file mode 100644
index 0000000..9d9832d
--- /dev/null
+++ b/layouts/partials/post-meta.html
@@ -0,0 +1,12 @@
+<span class="post-meta-item post-meta-date">
+ <time datetime="{{ .Date }}">{{ .Date.Format "2006-01-02" }} | </time>
+</span>
+<span class="post-meta-item post-meta-tags">
+ {{ if .Params.tags }}
+ {{ range .Params.tags }}
+ <a href="{{ $.Site.BaseURL }}/tags/{{ . | urlize }}/">{{ . }}</a>
+ {{ end }}
+ {{ else }}
+ <span>无标签</span>
+ {{ end }}
+</span> \ No newline at end of file
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
new file mode 100644
index 0000000..4caf7ba
--- /dev/null
+++ b/layouts/partials/scripts.html
@@ -0,0 +1,5 @@
+<script>
+ var lazyLoadInstance = new LazyLoad({
+ elements_selector: ".lazy"
+ });
+</script> \ No newline at end of file
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
new file mode 100644
index 0000000..5150a87
--- /dev/null
+++ b/layouts/partials/sidebar.html
@@ -0,0 +1,37 @@
+<div id="widget-pages">
+ <h5>页面</h5>
+ <ul>
+ {{ $currentPage := . }}
+ {{ range .Site.Menus.nav }}
+ <li>
+ <a href="{{ .URL }}">{{ .Name }}</a>
+ </li>
+ {{ end }}
+ </ul>
+</div>
+<div id="widget-tags">
+ <h5>标签</h5>
+ <div>
+ {{ range .Site.Taxonomies.tags }}
+ <span>
+ <a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a>
+ </span>
+ {{ end }}
+ </div>
+</div>
+<div id="widget-links">
+ <h5>链接</h5>
+ <ul>
+ {{ range .Site.Menus.link }}
+ <li>
+ <a href="{{ .URL }}" target="_blank"><span>{{ .Name }}</span></a>
+ </li>
+ {{ end }}
+ </ul>
+</div>
+{{ with .Site.Params.bgmImageChart }}
+<div id="widget-bgm">
+ <h5>番剧</h5>
+ <img class="lazy" src="{{ $.Site.Params.cdnLazyloadSRC }}" data-src="http://bgm.tv/chart/img/{{ . }}" />
+</div>
+{{ end }} \ No newline at end of file
diff --git a/layouts/tags/list.html b/layouts/tags/list.html
new file mode 100644
index 0000000..076cfc9
--- /dev/null
+++ b/layouts/tags/list.html
@@ -0,0 +1,42 @@
+{{ define "main" }}
+<main>
+ <div class="container-md clearfix">
+ <!-- list -->
+ <div class="col-md-9 col-12 float-left" id="content">
+ <!-- tags page range in posts -->
+ {{ if eq .RelPermalink "/tags/" }}
+ <span id="not-found">404 NOT FOUND</span>
+ {{ else }}
+ <div id="page-tag">
+ <span>拥有标签 {{ .Title }} 的文章:</span>
+ </div>
+ {{ range .Paginator.Pages }}
+ <div id="post">
+ <h2 id="post-title">
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ </h2>
+ <div id="post-meta">
+ {{ partial "post-meta.html" . }}
+ </div>
+ <div id="post-summary">
+ {{ .Summary }}
+ </div>
+ <div id="post-exlink">
+ <a href="{{ .Permalink }}#">&gt; READ MORE ...</a>
+ </div>
+ </div>
+ {{ end }}
+ {{ end }}
+ {{ if gt .Paginator.TotalPages 1 }}
+ <div id="pagination">
+ {{ template "_internal/pagination.html" . }}
+ </div>
+ {{ end }}
+ </div>
+ <!-- sidebar -->
+ <div class="col-md-3 col-12 float-left" id="sidebar">
+ {{ partial "sidebar.html" . }}
+ </div>
+ </div>
+</main>
+{{ end }} \ No newline at end of file