diff --git a/_data/icons.yml b/_data/icons.yml index 2545039..826f699 100644 --- a/_data/icons.yml +++ b/_data/icons.yml @@ -31,7 +31,7 @@ default:category: default:upup: - +default:tocomment: github:logo: github:repo: diff --git a/languages/en.yml b/languages/en.yml index c941590..6db44f6 100755 --- a/languages/en.yml +++ b/languages/en.yml @@ -14,6 +14,7 @@ btn: getting_started: Getting Started edit: Edit This Page top: Scroll to Top + bottom: Jump to Comment meta: recent_update: Recent Update diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index e79b130..f1a9070 100755 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -14,6 +14,7 @@ btn: getting_started: 开始使用 edit: 编辑本文 top: 回到顶部 + bottom: 评论跳转 meta: recent_update: 最近更新 diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index 627c5b3..a4f9551 100755 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -14,6 +14,7 @@ btn: getting_started: 開始使用 edit: 編輯本文 top: 回到頂部 + bottom: 評論跳轉 meta: recent_update: 最近更新 diff --git a/layout/_partial/menubtn.ejs b/layout/_partial/menubtn.ejs index 84e2146..543069d 100644 --- a/layout/_partial/menubtn.ejs +++ b/layout/_partial/menubtn.ejs @@ -5,4 +5,12 @@ + + <% if (page.comments) { %> + + <% } %> diff --git a/layout/_partial/widgets/toc.ejs b/layout/_partial/widgets/toc.ejs index 0c32481..88447bc 100644 --- a/layout/_partial/widgets/toc.ejs +++ b/layout/_partial/widgets/toc.ejs @@ -55,6 +55,10 @@ function layoutDiv(fallback) { el += icon('default:upup') el += `${__('btn.top')}` el += `` + el += `` + el += icon('default:tocomment') + el += `${__('btn.bottom')}` + el += `` el += `` el += `` return el diff --git a/source/js/main.js b/source/js/main.js index ce849f5..6c4ecaf 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -54,6 +54,10 @@ const util = { scrollTop: () => { window.scrollTo({top: 0, behavior: "smooth"}); }, + + scrollComment: () => { + document.getElementById('comments').scrollIntoView({behavior: "smooth"}); + }, } const hud = {