Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: docsifyjs/docsify
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.5.2
Choose a base ref
...
head repository: docsifyjs/docsify
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.6.0
Choose a head ref
  • 3 commits
  • 20 files changed
  • 1 contributor

Commits on Apr 9, 2017

  1. 1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9220523 View commit details
  2. bump: 3.6.0

    QingWei-Li committed Apr 9, 2017
    Copy the full SHA
    4f98497 View commit details
  3. -> v3.6.0

    QingWei-Li committed Apr 9, 2017
    Copy the full SHA
    432bcfb View commit details
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

# 3.6.0 / 2017-04-09

* feat(render): add mergeNavbar option, close ([#125](https://github.com/QingWei-Li/docsify/issues/125)

# 3.5.2/ 2017-04-05

* add optional current route param to toURL and use it to properly compose local anchor links
3 changes: 2 additions & 1 deletion dev.html
Original file line number Diff line number Diff line change
@@ -29,7 +29,8 @@
loadNavbar: true,
loadSidebar: true,
name: 'docsify',
subMaxLevel: 2
subMaxLevel: 2,
mergeNavbar: true
}
</script>
<script src="/lib/docsify.js"></script>
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![logo](_media/icon.svg)

# docsify <small>3.5</small>
# docsify <small>3.6</small>

> A magical documentation site generator.
8 changes: 4 additions & 4 deletions docs/_navbar.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- :uk:
- [:cn: 中文](/zh-cn/)
- [:de: Deutsch](/de-de/)
- [:uk: English](/)
- Translations
- [:cn: 中文](/zh-cn/)
- [:de: Deutsch](/de-de/)
- [:uk: English](/)
10 changes: 10 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -305,3 +305,13 @@ window.$docsify = {
noEmoji: true
}
```

## merge-navbar

Navbar will be merged with the sidebar on smaller screens.

```js
window.$docsify = {
mergeNavbar: true
}
```
4 changes: 0 additions & 4 deletions docs/de-de/_navbar.md

This file was deleted.

10 changes: 10 additions & 0 deletions docs/de-de/configuration.md
Original file line number Diff line number Diff line change
@@ -305,3 +305,13 @@ window.$docsify = {
noEmoji: true
}
```

## merge-navbar

Navbar will be merged with the sidebar on smaller screens.

```js
window.$docsify = {
mergeNavbar: true
}
```
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@
executeScript: true,
loadSidebar: true,
loadNavbar: true,
mergeNavbar: true,
maxLevel: 4,
name: 'docsify',
search: {
4 changes: 0 additions & 4 deletions docs/zh-cn/_navbar.md

This file was deleted.

11 changes: 11 additions & 0 deletions docs/zh-cn/configuration.md
Original file line number Diff line number Diff line change
@@ -315,3 +315,14 @@ window.$docsify = {
noEmoji: true
}
```

## merge-navbar

小屏设备下合并导航栏到侧边栏。

```js
window.$docsify = {
mergeNavbar: true
}
```

22 changes: 15 additions & 7 deletions lib/docsify.js
Original file line number Diff line number Diff line change
@@ -76,7 +76,8 @@ var config = merge({
autoHeader: false,
executeScript: null,
noEmoji: false,
ga: ''
ga: '',
mergeNavbar: false
}, window.$docsify);

var script = document.currentScript ||
@@ -3263,12 +3264,8 @@ function initRender (vm) {

var el = find(id);
var html = '';
var navAppendToTarget = body;

navEl.classList.add('app-nav');

if (!config.repo) {
navEl.classList.add('no-badge');
}
if (!el) {
el = create(id);
appendTo(body, el);
@@ -3283,8 +3280,19 @@ function initRender (vm) {
html += main(config);
// Render main app
vm._renderTo(el, html, true);

if (config.mergeNavbar && isMobile) {
navAppendToTarget = find('.sidebar');
} else {
navEl.classList.add('app-nav');

if (!config.repo) {
navEl.classList.add('no-badge');
}
}

// Add nav
before(body, navEl);
before(navAppendToTarget, navEl);

if (config.themeColor) {
$.head.innerHTML += theme(config.themeColor);
Loading