Skip to content

Commit

Permalink
feat: add logo option, #264 (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li authored Jun 19, 2018
1 parent 6c7ebc9 commit ee72dd0
Show file tree
Hide file tree
Showing 6 changed files with 192 additions and 142 deletions.
112 changes: 61 additions & 51 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ You can configure the `window.$docsify`.

## el

* Type: `String`
* Default: `#app`
- Type: `String`
- Default: `#app`

The DOM element to be mounted on initialization. It can be a CSS selector string or an actual HTMLElement.

Expand All @@ -27,8 +27,8 @@ window.$docsify = {

## repo

* Type: `String`
* Default: `null`
- Type: `String`
- Default: `null`

Configure the repository url or a string of `username/repo` can add the [GitHub Corner](http://tholman.com/github-corners/) widget in the top right corner of the site.

Expand All @@ -42,8 +42,8 @@ window.$docsify = {

## maxLevel

* Type: `Number`
* Default: `6`
- Type: `Number`
- Default: `6`

Maximum Table of content level.

Expand All @@ -55,8 +55,8 @@ window.$docsify = {

## loadNavbar

* Type: `Boolean|String`
* Default: `false`
- Type: `Boolean|String`
- Default: `false`

Loads navbar from the Markdown file `_navbar.md` if **true**, or else from the path specified.

Expand All @@ -72,8 +72,8 @@ window.$docsify = {

## loadSidebar

* Type: `Boolean|String`
* Default: `false`
- Type: `Boolean|String`
- Default: `false`

Loads sidebar from the Markdown file `_sidebar.md` if **true**, or else from the path specified.

Expand All @@ -89,8 +89,8 @@ window.$docsify = {

## subMaxLevel

* Type: `Number`
* Default: `0`
- Type: `Number`
- Default: `0`

Add table of contents (TOC) in custom sidebar.

Expand All @@ -102,8 +102,8 @@ window.$docsify = {

## auto2top

* Type: `Boolean`
* Default: `false`
- Type: `Boolean`
- Default: `false`

Scrolls to the top of the screen when the route is changed.

Expand All @@ -115,8 +115,8 @@ window.$docsify = {

## homepage

* Type: `String`
* Default: `README.md`
- Type: `String`
- Default: `README.md`

`README.md` in your docs folder will be treated as homepage for your website, but sometimes you may need to serve another file as your homepage.

Expand All @@ -133,7 +133,7 @@ window.$docsify = {

## basePath

* Type: `String`
- Type: `String`

Base path of the website. You can set it to another directory or another domain name.

Expand All @@ -152,8 +152,8 @@ window.$docsify = {

## coverpage

* Type: `Boolean|String|String[]|Object`
* Default: `false`
- Type: `Boolean|String|String[]|Object`
- Default: `false`

Activate the [cover feature](cover.md). If true, it will load from `_coverpage.md`.

Expand All @@ -175,9 +175,21 @@ window.$docsify = {
};
```

## logo

- Type: `String`

Website logo as it appears in the sidebar, you can resize by CSS.

```js
window.$docsify = {
logo: '/_media/icon.svg'
};
```

## name

* Type: `String`
- Type: `String`

Website name as it appears in the sidebar.

Expand All @@ -189,8 +201,8 @@ window.$docsify = {

## nameLink

* Type: `String`
* Default: `window.location.pathname`
- Type: `String`
- Default: `window.location.pathname`

The name of the link.

Expand All @@ -208,7 +220,7 @@ window.$docsify = {

## markdown

* Type: `Function`
- Type: `Function`

See [Markdown configuration](markdown.md).

Expand All @@ -234,7 +246,7 @@ window.$docsify = {

## themeColor

* Type: `String`
- Type: `String`

Customize the theme color. Use [CSS3 variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables) feature and polyfill in old browser.

Expand All @@ -246,7 +258,7 @@ window.$docsify = {

## alias

* Type: `Object`
- Type: `Object`

Set the route alias. You can freely manage routing rules. Supports RegExp.

Expand All @@ -264,7 +276,7 @@ window.$docsify = {

## autoHeader

* type: `Boolean`
- type: `Boolean`

If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.md`, prepend a header to the page before converting it to html. Compare [#78](https://github.com/QingWei-Li/docsify/issues/78).

Expand All @@ -277,7 +289,7 @@ window.$docsify = {

## executeScript

* type: `Boolean`
- type: `Boolean`

Execute the script on the page. Only parse the first script tag([demo](themes)). If Vue is present, it is turned on by default.

Expand All @@ -299,7 +311,7 @@ Note that if you are running an external script, e.g. an embedded jsfiddle demo,

## noEmoji

* type: `Boolean`
- type: `Boolean`

Disabled emoji parse.

Expand All @@ -311,7 +323,7 @@ window.$docsify = {

## mergeNavbar

* type: `Boolean`
- type: `Boolean`

Navbar will be merged with the sidebar on smaller screens.

Expand All @@ -323,7 +335,7 @@ window.$docsify = {

## formatUpdated

* type: `String|Function`
- type: `String|Function`

We can display the file update date through **{docsify-updated<span>}</span>** variable. And format it by `formatUpdated`.
See https://github.com/lukeed/tinydate#patterns
Expand All @@ -342,8 +354,8 @@ window.$docsify = {

## externalLinkTarget

* type: `String`
* default: `_blank`
- type: `String`
- default: `_blank`

Target to open external links. Default `'_blank'` (new window/tab)

Expand All @@ -355,8 +367,8 @@ window.$docsify = {

## routerMode

* type: `String`
* default: `history`
- type: `String`
- default: `history`

```js
window.$docsify = {
Expand All @@ -366,7 +378,7 @@ window.$docsify = {

## noCompileLinks

* type: `Array`
- type: `Array`

Sometimes we do not want docsify to handle our links. See [#203](https://github.com/QingWei-Li/docsify/issues/203)

Expand All @@ -378,7 +390,7 @@ window.$docsify = {

## onlyCover

* type: `Boolean`
- type: `Boolean`

Only coverpage is loaded when visiting the home page.

Expand All @@ -390,7 +402,7 @@ window.$docsify = {

## requestHeaders

* type: `Object`
- type: `Object`

Set the request resource headers.

Expand All @@ -404,7 +416,7 @@ window.$docsify = {

## ext

* type: `String`
- type: `String`

Request file extension.

Expand All @@ -416,53 +428,51 @@ window.$docsify = {

## fallbackLanguages

* type: `Array<string>`
- type: `Array<string>`

List of languages that will fallback to the default language when a page is request and didn't exists for the given local.

Example:

- try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
- then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
- then display 404 page.

- try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
- then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
- then display 404 page.

```js
window.$docsify = {
fallbackLanguages: [
"fr",
"de"
]
fallbackLanguages: ['fr', 'de']
};
```


## notFoundPage

* type: `Boolean` | `String` | `Object`
- type: `Boolean` | `String` | `Object`

Load the `_404.md` file:

```js
window.$docsify = {
notFoundPage: true
};
```

Load the customised path of the 404 page:

```js
window.$docsify = {
notFoundPage: 'my404.md'
};
```

Load the right 404 page according to the localisation:

```js
window.$docsify = {
notFoundPage: {
'/': '_404.md',
'/de': 'de/_404.md',
'/de': 'de/_404.md'
}
};
```
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.

> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
Loading

0 comments on commit ee72dd0

Please sign in to comment.