summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/_markup/render-image.html4
-rw-r--r--layouts/_default/index.json5
-rw-r--r--layouts/_default/search.html20
-rw-r--r--layouts/_default/single.html2
-rw-r--r--layouts/partials/head.html13
-rw-r--r--layouts/partials/scripts-end.html20
-rw-r--r--layouts/shortcodes/img-lazy.html32
-rw-r--r--layouts/shortcodes/img-nz-lazy.html25
-rw-r--r--layouts/shortcodes/img-nz.html7
9 files changed, 67 insertions, 61 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
index b9020c7..1b20943 100644
--- a/layouts/_default/_markup/render-image.html
+++ b/layouts/_default/_markup/render-image.html
@@ -1 +1,3 @@
-<img class="img-zoomable" src="{{ .Destination | safeURL }}" alt="{{ .Text }}" /> \ No newline at end of file
+<a href="{{ .Destination | safeURL }}" target="_blank">
+ <img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" />
+</a> \ No newline at end of file
diff --git a/layouts/_default/index.json b/layouts/_default/index.json
new file mode 100644
index 0000000..a823e62
--- /dev/null
+++ b/layouts/_default/index.json
@@ -0,0 +1,5 @@
+{{- $.Scratch.Add "search" slice -}}
+{{- range (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) -}}
+ {{- $.Scratch.Add "search" (dict "title" .Title "tags" .Params.tags "contents" .Plain "permalink" .Permalink) -}}
+{{- end -}}
+{{- $.Scratch.Get "search" | jsonify -}} \ No newline at end of file
diff --git a/layouts/_default/search.html b/layouts/_default/search.html
new file mode 100644
index 0000000..b92861a
--- /dev/null
+++ b/layouts/_default/search.html
@@ -0,0 +1,20 @@
+{{ define "main" }}
+<!-- page info section e.g. current tag & total archive pages -->
+<div class="page-info">
+ <form class="search-form" autocomplete="off">
+ <div class="search-input">
+ <input type="text" name="search-input" maxlength="40" required />
+ </div>
+ <div class="search-submit">
+ <button>搜索</button>
+ </div>
+ </form>
+</div>
+<!-- archives range in all posts -->
+<div class="post">
+ <h3 class="post-item post-title-archive">
+ Not Finished Yet
+ </h3>
+</div>
+
+{{ end }} \ No newline at end of file
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index db5e2f5..413cacc 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -7,7 +7,7 @@
<div class="post-item post-meta">
{{ partial "post-meta.html" . }}
</div>
- {{ with .Params.playerURL }}
+ {{ with .Params.player }}
<div id="post-aplayer"></div>
{{ end }}
<!-- post main content -->
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index b953cd8..88f398f 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -41,16 +41,11 @@
<link rel="stylesheet" href="{{ "/assets/css/fuji.min.css" | relURL }}" />
{{ end }}
-{{ if .Site.Params.googleAdsense }}
-<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
-<script>
- (adsbygoogle = window.adsbygoogle || []).push({
- enable_page_level_ads: true,
- google_ad_client: "ca-pub-{{.Site.Params.googleAdsense}}",
- });
-</script>
+{{ with .Site.Params.googleAdsense }}
+<script async data-ad-client="ca-pub-{{ . }}" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
{{ end}}
-{{ if .Params.playerURL }}
+
+{{ if .Params.player }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css" />
{{ end }}
{{ if .Site.Params.useDisqusJS }}
diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html
index 862e0e2..e5426ad 100644
--- a/layouts/partials/scripts-end.html
+++ b/layouts/partials/scripts-end.html
@@ -4,10 +4,9 @@
<script defer src="https://cdn.jsdelivr.net/npm/prismjs@1.20.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/lazysizes@5.2.2/lazysizes.min.js"></script>
-<script defer src="https://cdn.jsdelivr.net/npm/medium-zoom@1.0.5/dist/medium-zoom.min.js"></script>
<script defer src="{{ "/assets/js/fuji.min.js" | relURL }}"></script>
-{{ with .Params.playerURL }}
+{{ with .Params.player }}
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js"></script>
<script>
// in-post aplayer
@@ -15,12 +14,17 @@
container: document.getElementById('post-aplayer'),
theme: '#8f82bc',
volume: 0.1,
- audio: [{
- name: '{{ $.Params.playerName }}',
- artist: '{{ $.Params.playerArtist }}',
- url: '{{ . }}',
- cover: '{{ $.Params.playerCover }}'
- }]
+ listFolded: true,
+ audio: [
+ {{- range $.Params.player -}}
+ {
+ name: '{{ .playerName }}',
+ artist: '{{ .playerArtist }}',
+ url: '{{ .playerURL }}',
+ cover: '{{ .playerCover }}'
+ },
+ {{- end -}}
+ ]
});
// aplayer toc anchors fix
// see https://github.com/MoePlayer/APlayer/issues/242#issuecomment-602471423
diff --git a/layouts/shortcodes/img-lazy.html b/layouts/shortcodes/img-lazy.html
index fef9bd3..e57b8fb 100644
--- a/layouts/shortcodes/img-lazy.html
+++ b/layouts/shortcodes/img-lazy.html
@@ -1,10 +1,22 @@
-{{ if len .Params | eq 2 }}
-<img class="lazyload img-zoomable" src="{{ .Site.Params.lazyPlaceholder | relURL }}" data-src="{{ index .Params 1 }}"
- alt="{{ index .Params 0 }}" />
-{{ else if len .Params | eq 3 }}{{ if eq (index .Params 0) "row" }}
-<img class="lazyload img-zoomable" src="{{ .Site.Params.lazyPlaceholderRow | relURL }}" data-src="{{ index .Params 2 }}"
- alt="{{ index .Params 1 }}" />
-{{ else if eq (index .Params 0) "col" }}
-<img class="lazyload img-zoomable" src="{{ .Site.Params.lazyPlaceholderCol | relURL }}" data-src="{{ index .Params 2 }}"
- alt="{{ index .Params 1 }}" />
-{{ else }}{{ end }}{{ else }}{{ end }} \ No newline at end of file
+{{- if len .Params | eq 2 -}}
+<p>
+ <a href="{{ index .Params 1 | safeURL }}" target="_blank">
+ <img class="lazyload" src="{{ .Site.Params.lazyPlaceholder | relURL }}"
+ data-src="{{ index .Params 1 | safeURL }}" alt="{{ index .Params 0 }}" />
+ </a>
+</p>
+{{- else if len .Params | eq 3 }}{{ if eq (index .Params 0) "row" -}}
+<p>
+ <a href="{{ index .Params 2 | safeURL }}" target="_blank">
+ <img class="lazyload" src="{{ .Site.Params.lazyPlaceholderRow | relURL }}"
+ data-src="{{ index .Params 2 | safeURL }}" alt="{{ index .Params 1 }}" />
+ </a>
+</p>
+{{- else if eq (index .Params 0) "col" -}}
+<p>
+ <a href="{{ index .Params 2 | safeURL }}" target="_blank">
+ <img class="lazyload" src="{{ .Site.Params.lazyPlaceholderCol | relURL }}"
+ data-src="{{ index .Params 2 | safeURL }}" alt="{{ index .Params 1 }}" />
+ </a>
+</p>
+{{- else -}}{{- end -}}{{- else -}}{{ end -}} \ No newline at end of file
diff --git a/layouts/shortcodes/img-nz-lazy.html b/layouts/shortcodes/img-nz-lazy.html
deleted file mode 100644
index bfdb26a..0000000
--- a/layouts/shortcodes/img-nz-lazy.html
+++ /dev/null
@@ -1,25 +0,0 @@
-{{ if len .Params | eq 2 }}
-<img class="lazyload" src="{{ .Site.Params.lazyPlaceholder | relURL }}" data-src="{{ index .Params 1 }}"
- alt="{{ index .Params 0 }}" />
-{{ else if len .Params | eq 3 }}{{ if eq (index .Params 0) "row" }}
-<img class="lazyload" src="{{ .Site.Params.lazyPlaceholderRow | relURL }}" data-src="{{ index .Params 2 }}"
- alt="{{ index .Params 1 }}" />
-{{ else if eq (index .Params 0) "col" }}
-<img class="lazyload" src="{{ .Site.Params.lazyPlaceholderCol | relURL }}" data-src="{{ index .Params 2 }}"
- alt="{{ index .Params 1 }}" />
-{{ else }}
-<a href="{{ index .Params 2 }}" target="_blank">
- <img class="lazyload" src="{{ .Site.Params.lazyPlaceholder | relURL }}" data-src="{{ index .Params 1 }}"
- alt="{{ index .Params 0 }}" />
-</a>
-{{ end }}{{ else if len .Params | eq 4 }}{{ if eq (index .Params 0) "row" }}
-<a href="{{ index .Params 3 }}" target="_blank">
- <img class="lazyload" src="{{ .Site.Params.lazyPlaceholderRow | relURL }}" data-src="{{ index .Params 2 }}"
- alt="{{ index .Params 1 }}" />
-</a>
-{{ else if eq (index .Params 0) "col" }}
-<a href="{{ index .Params 3 }}" target="_blank">
- <img class="lazyload" src="{{ .Site.Params.lazyPlaceholderCol | relURL }}" data-src="{{ index .Params 2 }}"
- alt="{{ index .Params 1 }}" />
-</a>
-{{ else }}{{ end }}{{ else }}{{ end }} \ No newline at end of file
diff --git a/layouts/shortcodes/img-nz.html b/layouts/shortcodes/img-nz.html
deleted file mode 100644
index 1b4f791..0000000
--- a/layouts/shortcodes/img-nz.html
+++ /dev/null
@@ -1,7 +0,0 @@
-{{ if (index .Params 2) }}
-<a href="{{ index .Params 2 }}" target="_blank">
- <img src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" />
-</a>
-{{ else }}
-<img src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" />
-{{ end }} \ No newline at end of file