New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar affix not work when set display to always [fix added] #328

Closed
henryhoo opened this Issue Jun 17, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@henryhoo
Copy link

henryhoo commented Jun 17, 2018

I agree and want to create new issue


Expected behavior

  • Menus have enough space on sidebar
  • Sidebar is sticky

Actual behavior

  • Menus do not have enough space on sidebar after enabling local seach menu (NexT.Pisces v6.2.0)

screen shot 2018-06-17 at 4 19 15 am

* Sidebar is not sticky

screen shot 2018-06-17 at 4 38 04 am

screen shot 2018-06-17 at 4 38 44 am

Steps to reproduce the behavior

  1. Add multipal menus
  menu:
    home: / || home
    about: /about/ || user
    tags: /tags/ || tags
    categories: /categories/ || th
  1. Enable local search
local_search:
  enable: true
  1. Set sidebar display to always
  sidebar:
    display: always
  • Link to demo site with this issue: N/A
  • Link(s) to source code or any usefull link(s): N/A

Node.js and NPM Information

v9.10.1
5.6.0

┌──────────────────────────────────────────────────────────┐
│                 npm update check failed                  │
│           Try running with sudo or get access            │
│           to the local update config store via           │
│ sudo chown -R $USER:$(id -gn $USER) /Users/henry/.config │
└──────────────────────────────────────────────────────────┘

Package dependencies Information

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.7.1"
  },
  "dependencies": {
    "hexo": "^3.7.1",
    "hexo-deployer-git": "^0.3.1",
    "hexo-generator-archive": "^0.1.4",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.0",
    "hexo-generator-searchdb": "^1.0.8",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.0",
    "hexo-renderer-marked": "^0.3.2",
    "hexo-renderer-stylus": "^0.3.3",
    "hexo-server": "^0.2.0"
  }
}

Hexo Information

Hexo version

hexo: 3.7.1
hexo-cli: 1.1.0
os: Darwin 17.4.0 darwin x64
http_parser: 2.8.0
node: 9.10.1
v8: 6.2.414.46-node.23
uv: 1.19.2
zlib: 1.2.11
ares: 1.13.0
modules: 59
nghttp2: 1.29.0
napi: 2
openssl: 1.0.2o
icu: 60.2
unicode: 10.0
cldr: 32.0.1
tz: 2017c

Hexo Configuration

NexT Information

NexT Version:

  • Latest Master branch
  • Latest Release version
  • Old version

NexT Scheme:

  • All schemes
  • Muse
  • Mist
  • Pisces
  • Gemini

NexT Configuration:

  scheme: Pisces
  avatar: /images/avatar.jpg
  sidebar:
    display: always
  social:
    GitHub: https://github.com/henryhoo || github
    FB Page: https://www.facebook.com/jiaxi.henry.he || facebook
    StackOverflow: https://stackoverflow.com/users/6211857/jiaxi-he || stack-overflow
    Instagram: https://www.instagram.com/jiaxi_h || instagram
  menu:
    home: / || home
    about: /about/ || user
    tags: /tags/ || tags
    categories: /categories/ || th
  reward_comment: Donate
  wechatpay: /images/wechatpay.jpg
  leancloud_visitors:
    enable: true
    app_id: xxxxxxxx
    app_key: xxxxxxxx
    # Dependencies: https://github.com/theme-next/hexo-leancloud-counter-security
    # If you don't care about security in lc counter and just want to use it directly
    # (without hexo-leancloud-counter-security plugin), set the `security` to `false`.
    security: false
    betterPerformance: false
  gitment:
    enable: true
    mint: true # RECOMMEND, A mint on Gitment, to support count, language and proxy_gateway
    count: true # Show comments count in post meta area
    lazy: false # Comments lazy loading with a button
    cleanly: false # Hide 'Powered by ...' on footer, and more
    language: # Force language, or auto switch by theme
    github_user: henryhoo # MUST HAVE, Your Github ID
    github_repo: gitment-comments # MUST HAVE, The repo you use to store Gitment comments
    client_id: xxxxxxxx # MUST HAVE, Github client id for the Gitment
    client_secret: xxxxxxxx # EITHER this or proxy_gateway, Github access secret token for the Gitment
    proxy_gateway: # Address of api proxy, See: https://github.com/aimingoo/intersect
    redirect_protocol: # Protocol of redirect_uri with force_redirect_protocol when mint enabled
  links_layout: inline
  links:
    Xingyao: http://xingyaohuang.com
    Yiwen: https://yiwencui.wixsite.com/portfolio
  add_this_id: xxxxxxxx-xxxxxxxx
  local_search:
    enable: true
    trigger: auto
    # show top n results per article, show all results by setting to -1
    top_n_per_article: 1
    # unescape html strings to the readable one
    unescape: true
  footer:
    # Specify the date when the site was setup.
    # If not defined, current year will be used.
    since: 2016

Other Information

@henryhoo henryhoo changed the title Menus do not have enough space on sidebar Floating menu gets wrong on sidebar Jun 17, 2018

@ivan-nginx

This comment has been minimized.

Copy link
Member

ivan-nginx commented Jun 17, 2018

It seems sidebar affix not work on your site. When post scrolling down, second block of sidebar must be sticky. Maybe you modify something, i suggest to install clean NexT version and recheck it again.

image

Sidebar must be sticky when scrolling down:

image

@henryhoo

This comment has been minimized.

Copy link
Author

henryhoo commented Jun 17, 2018

@ivan-nginx Yes, I just found this problem too. It seems because I set sidebar to always display:

  sidebar:
    display: always

If I do not use "awlays display", sidebar will back to sticky. Any idea how to debug this? Thanks.

@henryhoo henryhoo changed the title Floating menu gets wrong on sidebar sidebar affix not work when set display to always Jun 17, 2018

@henryhoo

This comment has been minimized.

Copy link
Author

henryhoo commented Jun 17, 2018

Find the problem:
We should be careful with config override. I forget to declare other sections except "display" for sidebar config:

  sidebar:
    display: always

This cause the theme config is missing other sections including "offset" which is critical to sidebar affix, change to following config works:

  sidebar:
    position: left
    display: always
    offset: 12
    b2t: false
    scrollpercent: false
    onmobile: false

@ivan-nginx ivan-nginx added the Solved label Jun 17, 2018

@ivan-nginx ivan-nginx changed the title sidebar affix not work when set display to always Sidebar affix not work when set display to always Jun 17, 2018

@ivan-nginx ivan-nginx closed this Jun 17, 2018

@ivan-nginx ivan-nginx added Irrelevant and removed Irrelevant labels Jul 4, 2018

@ivan-nginx ivan-nginx added Bugfix and removed Irrelevant labels Sep 13, 2018

@ivan-nginx ivan-nginx changed the title Sidebar affix not work when set display to always Sidebar affix not work when set display to always [fix added] Sep 13, 2018

ivan-nginx added a commit that referenced this issue Sep 13, 2018

@ivan-nginx ivan-nginx added this to the v6.5.0 milestone Sep 13, 2018

@ivan-nginx ivan-nginx removed this from the v6.4.2 milestone Sep 30, 2018

ivan-nginx added a commit that referenced this issue Oct 3, 2018

Jona-lee added a commit to Jona-lee/hexo-theme-next that referenced this issue Oct 10, 2018

Jona-lee added a commit to Jona-lee/hexo-theme-next that referenced this issue Oct 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment