summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_config.yml12
-rw-r--r--layout/_partial/header.ejs12
-rw-r--r--layout/post.ejs12
3 files changed, 32 insertions, 4 deletions
diff --git a/_config.yml b/_config.yml
index 0ad21fb..0d86089 100644
--- a/_config.yml
+++ b/_config.yml
@@ -8,6 +8,18 @@ logo:
lightmode: null
darkmode: null
+# Header size
+# Select from: ["fullheight", "large", "medium", "default"]
+# The page will be scroll to post thumbnail if autoscroll enabled
+# ------------------------------------------------------------
+# 选择 Header 的大小
+# 从大到小依次可以选择:["fullheight", "large", "medium", "default"]
+# 如果启用 autoscroll 在进入文章后会自动跳转至文章 Thumbnail 处
+header:
+ index: large
+ other: medium
+ autoscroll: true
+
# Favicon file link
# ------------------------------------------------------------
# Favicon 文件地址
diff --git a/layout/_partial/header.ejs b/layout/_partial/header.ejs
index 34097f7..a9d9dbd 100644
--- a/layout/_partial/header.ejs
+++ b/layout/_partial/header.ejs
@@ -1,7 +1,7 @@
-<% if (is_post()) { %>
-<section class="hero is-medium auto-dark">
+<% if (is_home()) { %>
+<section class="hero is-<%= theme.header.index %> auto-dark">
<% } else { %>
-<section class="hero is-large auto-dark">
+<section class="hero is-<%= theme.header.other %> auto-dark">
<% } %>
<div class="hero-head">
<header class="navbar" aria-label="main navigation">
@@ -69,4 +69,10 @@
</p>
</div>
</div>
+
+ <% if (is_home()) { %>
+ <div class="hero-foot">
+
+ </div>
+ <% } %>
</section> \ No newline at end of file
diff --git a/layout/post.ejs b/layout/post.ejs
index 9d9c8df..1419b70 100644
--- a/layout/post.ejs
+++ b/layout/post.ejs
@@ -1,6 +1,16 @@
<div class="columns">
<div class="column is-8 is-offset-2">
- <div class="card">
+ <div id="post" class="card">
+ <% if (theme.header.autoscroll) { %>
+ <script>
+ window.addEventListener("load", ()=>{
+ let content = document.getElementById("post");
+ content.scrollIntoView({
+ behavior: "smooth"
+ });
+ });
+ </script>
+ <% } %>
<% if (page.thumbnail) { %>
<div class="card-iamge">
<figure class="image is-16by9">