Skip to content

Commit

Permalink
feat: add new config param displayBackToTopOnMobile
Browse files Browse the repository at this point in the history
updates #280
  • Loading branch information
reuixiy committed Dec 16, 2020
1 parent e927542 commit 9d7ce99
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
6 changes: 4 additions & 2 deletions assets/scss/base/_responsive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
transform: none;
float: right;
}
#back-to-top {
display: none;
@if (not $displayBackToTopOnMobile) {
#back-to-top {
display: none;
}
}
@if ($headerLayoutFlex) {
.header-inner {
Expand Down
6 changes: 6 additions & 0 deletions assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
$enableNavToggle: false;
{{ end }}

{{ if .Site.Params.displayBackToTopOnMobile }}
$displayBackToTopOnMobile: true;
{{ else }}
$displayBackToTopOnMobile: false;
{{ end }}

{{ if .Site.Params.enableOverflowY }}
$enableOverflowY: true;
{{ else }}
Expand Down
2 changes: 2 additions & 0 deletions config-examples/en/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,8 @@ uglyURLs = false

displayBackToTopInHome = true

displayBackToTopOnMobile = false

backToTopIcon = "arrow-up"


Expand Down
3 changes: 3 additions & 0 deletions config-examples/zh-cn/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,9 @@ uglyURLs = false
# 是否在首页显示
displayBackToTopInHome = true

# 是否在移动端显示
displayBackToTopOnMobile = false

# 按钮图标
backToTopIcon = "arrow-up"

Expand Down
3 changes: 3 additions & 0 deletions config-examples/zh-tw/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,9 @@ uglyURLs = false
# 是否在首頁顯示
displayBackToTopInHome = true

# 是否在移動端顯示
displayBackToTopOnMobile = false

# 按鈕圖示
backToTopIcon = "arrow-up"

Expand Down

0 comments on commit 9d7ce99

Please sign in to comment.