summaryrefslogtreecommitdiff
path: root/layout/post.ejs
diff options
context:
space:
mode:
authorDoge <[email protected]>2021-05-21 01:53:08 +0800
committerDoge <[email protected]>2021-05-21 01:53:08 +0800
commitef9166a92607093dea593653a9977fba40d82ad3 (patch)
tree5d499dea3a8c0a5160b702f68616c03f94e2f5ad /layout/post.ejs
parentd187e68f0e2233b8440d190136cc9087c49b9342 (diff)
downloadchromate-ef9166a92607093dea593653a9977fba40d82ad3.tar.gz
chromate-ef9166a92607093dea593653a9977fba40d82ad3.tar.bz2
chromate-ef9166a92607093dea593653a9977fba40d82ad3.zip
Add header adjustment with autoscroll
Diffstat (limited to 'layout/post.ejs')
-rw-r--r--layout/post.ejs12
1 files changed, 11 insertions, 1 deletions
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">