Skip to content

Commit

Permalink
fix: make sourcePath default to ./
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Dec 16, 2018
1 parent b3eae9d commit fd178c2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const slugify = str => {
}

export const getFilenameByPath = (sourcePath, path) => {
sourcePath = sourcePath || ''
sourcePath = sourcePath || './'
sourcePath = sourcePath.replace(/\/$/, '')
if (/\.md$/.test(path)) {
return sourcePath + path
Expand Down
4 changes: 2 additions & 2 deletions website/docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ interface ItemLink {
## sourcePath

- Type: `string`
- Default: `'/'`
- Default: `'./'`

The source path to fetch markdown files from, by default we load them from the root path, a.k.a. `/`.
The source path to fetch markdown files from, by default we load them from path where your `index.html` is populated.

It can also be a full URL like: `https://some-website/path/to/markdown/files` so that you can load files from a different domain.

Expand Down
4 changes: 2 additions & 2 deletions website/docs/zh/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ interface ItemLink {
## sourcePath

- 类型:`string`
- 默认值:`'/'`
- 默认值:`'./'`

从 source path 获取 markdown 文件,默认情况下,我们从根目录加载它们,根目录也被称为 `/`
从 source path 获取 markdown 文件,默认情况下,我们从 `index.html` 所在的目录加载它们

它也可以是完整的 URL,例如: `https://some-website/path/to/markdown/files`,以便于你可以从其他域名加载文件。

Expand Down

0 comments on commit fd178c2

Please sign in to comment.