summaryrefslogtreecommitdiff
path: root/layouts/partials
diff options
context:
space:
mode:
authorReorx <novoreorx@gmail.com>2022-09-08 21:56:46 +0800
committerReorx <novoreorx@gmail.com>2022-09-08 21:56:46 +0800
commitae58c91ac49e822fd2cf8c5aa1b36cea0f8470ee (patch)
tree48a9819bced94c6c29b0c171e80bc61bcd6b9ae5 /layouts/partials
parentcd0381f6d3b86adb02702f1848283d9f19b017b5 (diff)
parentbb02a60990dd79f9828798a044776984d51ff5da (diff)
Merge branch 'newsletter'
* newsletter: (28 commits) newsletter section: only show list when there are pages lower nav height in mobile use content-gap instead of gap for header consistant header gaps subtle adjustments clear debug code finish newsletter archives add newsletter sub box in single enhance inline links fix rss pages query newsletter regular page responsive enlarge post footer bottom border size from 1 to 3px fix all pages query issues in: list, archives, newsletter section, post_nav_links fixup! finish newsletter section styling newsletter section page responsive finish newsletter section styling adjust first-entry ul/ol margin styling newsletter section list rename .list to .list-page styling newsletter sub form ...
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/head.html9
-rw-r--r--layouts/partials/header.html2
-rw-r--r--layouts/partials/newsletter_brand.html8
-rw-r--r--layouts/partials/newsletter_sub_form.html8
-rw-r--r--layouts/partials/post_nav_links.html8
5 files changed, 29 insertions, 6 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 1889a85..165afb4 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -47,10 +47,11 @@
{{- /* order is important */}}
{{- $core := (slice $theme_vars $reset $common $commonHighlight $media) | resources.Concat "assets/css/core.css" }}
{{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" }}
+{{- $extendedScss := (resources.Match "css/extended/*.scss") | resources.Concat "assets/css/extended.scss" | resources.ToCSS }}
{{- /* bundle all required css */}}
{{- /* Add extended css after theme style */ -}}
-{{- $stylesheet := (slice $core $extended) | resources.Concat "assets/css/stylesheet.css" | minify }}
+{{- $stylesheet := (slice $core $extended $extendedScss) | resources.Concat "assets/css/stylesheet.css" | minify }}
{{- if not site.Params.assets.disableFingerprinting }}
{{- $stylesheet := $stylesheet | fingerprint }}
@@ -125,15 +126,15 @@
--border: rgb(51, 51, 51);
}
- .list {
+ .list-page {
background: var(--theme);
}
- .list:not(.dark)::-webkit-scrollbar-track {
+ .list-page:not(.dark)::-webkit-scrollbar-track {
background: 0 0;
}
- .list:not(.dark)::-webkit-scrollbar-thumb {
+ .list-page:not(.dark)::-webkit-scrollbar-thumb {
border-color: var(--theme);
}
}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 1061d5b..01f2b41 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -133,7 +133,7 @@ function toggleThemeListener() {
<a href="{{ $menu_item_url }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}"
{{- if $is_search -}}data-no-instant{{- end -}}
{{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}
- {{- if eq $menu_item_url $page_url }} class="active" {{- end }}
+ {{- if strings.HasPrefix $page_url $menu_item_url }} class="active" {{- end }}
{{- if .Params.External }} target="_blank" {{- end }}
>
{{- .Pre }}
diff --git a/layouts/partials/newsletter_brand.html b/layouts/partials/newsletter_brand.html
new file mode 100644
index 0000000..03c10ee
--- /dev/null
+++ b/layouts/partials/newsletter_brand.html
@@ -0,0 +1,8 @@
+<a class="newsletter-brand" href="{{ .Parent.Permalink }}">
+ <div class="icon">@</div>
+ <div class="name">{{ .Param "newsletterName" }}</div>
+ {{ with .Param "issueno" }}<div class="remark">#{{ . }}</div>{{ end }}
+ <div class="arrow">
+ <svg xmlns="http://www.w3.org/2000/svg" width="34" height="34" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>
+ </div>
+</a>
diff --git a/layouts/partials/newsletter_sub_form.html b/layouts/partials/newsletter_sub_form.html
new file mode 100644
index 0000000..3cee447
--- /dev/null
+++ b/layouts/partials/newsletter_sub_form.html
@@ -0,0 +1,8 @@
+{{/* Add `layouts/partials/newsletter_sub_form.html` in your own code to customize the form */}}
+
+<div class="sub-form">
+ <form action="">
+ <input type="text" name="email" placeholder="Your email address">
+ <button>订阅 | Subscribe</button>
+ </form>
+</div>
diff --git a/layouts/partials/post_nav_links.html b/layouts/partials/post_nav_links.html
index 2d1eaa9..05e68a3 100644
--- a/layouts/partials/post_nav_links.html
+++ b/layouts/partials/post_nav_links.html
@@ -1,4 +1,10 @@
-{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
+{{/* get pages from the current page's section */}}
+{{- $sections := site.Params.mainSections }}
+{{- if .Section }}
+ {{- $sections = slice .Section }}
+{{- end }}
+{{- $pages := where (where site.RegularPages "Section" "in" $sections) "Params.hidden" "!=" true }}
+
{{- if and (gt (len $pages) 1) (in $pages . ) }}
<nav class="paginav">
{{- with $pages.Next . }}