Redesigned mobile navbar, ToC highlight, updated gitalk and so on #616
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for this incredible theme! I have been playing with it for days, and made some revisions based on my own needs. I just sorted out some of them and see whether it's helpful for you.
Redesigned mobile navbar
I put the tabs into a navbar-burger, but keep the toc and search outside.
Sticky navbar
If
navbar.sticky
is set, the navbar can stick on the top as page scroll. Top margins of sticky sidebars are adjusted automatically.Dropdown menus on navbar
ToC highlight
Also the scroll positions of toc links are adjusted so that the headers won't be covered by sticky navbar (reference)
More flexible settings for pages and posts respectively
I would like to have different layouts for pages (home, tags, archives, etc.) and posts, so I add quite a lot of settings.
Hide left and/or right columns in posts
Set
sidebar.left.hide_in_post
and/orsidebar.right.hide_in_post
totrue
.Hide left and/or right columns in a specific post
Add
no_left_widget: true
and/orno_right_widget: true
at the beginning of a post .md file.Hide a widget in posts
Set
widgets.?.hide_in_post
totrue
.Left and/or right columns sticky only on pages
Set
sidebar.left.sticky_page_only
and/orsidebar.right.sticky_page_only
totrue
.Sticky ToC
Set
sticky
in ToC config.Allow disabling shadow right sidebar in left sidebar
set
sidebar.left.shadow_right
tofalse
For me, I set left and right columns sticky on pages, so the left and right areas won't seem so empty as I scroll down the main page (demo).
But in posts, I hide the right columns, hide all widgets except profile and toc, set left column not sticky but toc sticky. So as I scroll down, the left sidebar will goes up but toc will finally stick to the top. (demo)
New layout 'error_page' and 'raw'
I wan't to customize some pages but keep Hexo generate header and footer.
For the
error_page
layout (writelayout: error_page
at the beginning of the md file), all widgets and comments will be hidden, leaving only header, footer and the main column, which can be used to generate error pages (demo).The
raw
layout, (writelayout: raw
at the beginning of the md file) don't even generate any columns, giving more flexibility for those who want to directly write html (between{% raw%}
and{% endraw %}
) but keep header, footer and the ability of using markdown.Customize how a post/page appears in insight search
summary: (your excerpt)
at the beginning of md file and insight will use it as the excerpt of the post/page.hide_in_search: true
at the beginning of md file to hide the post/page in insight search.Fix Gitalk against Github warning email of API deprecation.
See this issue. Since gitalk hasn't been updated on npm for long, I use this pull request and made it a local js file.
I also revise some spec files, but I haven't test whether it can generate correct default configs. Maybe you want to have a test on it :)