Skip to content

Commit

Permalink
fix: publicUrl behaviour #261 (#263)
Browse files Browse the repository at this point in the history
* fix: #261

* fix: absolute paths/urls only

* docs: elaborate publicUrl

* use __PUBLIC_URL__

* tweaks
  • Loading branch information
krmax44 authored and egoist committed Jun 14, 2019
1 parent 9c0f718 commit 1bcfd21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/saber/vue-renderer/app/router.js
Expand Up @@ -35,6 +35,7 @@ export default () => {
new Router({
mode: 'history',
routes,
base: __PUBLIC_URL__,
scrollBehavior(to, from, savedPosition) {
// if the returned position is falsy or an empty object,
// will retain current scroll position.
Expand Down
16 changes: 8 additions & 8 deletions website/pages/docs/saber-config.md
Expand Up @@ -60,7 +60,7 @@ The directory to output HTML files and other static assets.
- Type: `string`
- Default: `/`

The base URL your application will be deployed at. If your website is located at a sub directory, e.g. `https://example.com/blog`, you should set this option to `/blog/` (trailing slash is optional).
The base URL your application will be deployed at. If your website is located at a sub directory, e.g. `https://example.com/blog`, you should set this option to either an absolute path (like `/blog`, leading slash is required) or an absolute URL (like `https://example.com/blog`).

### extractCSS

Expand Down Expand Up @@ -138,13 +138,13 @@ You can use the [limax](https://github.com/lovell/limax) which provides CJK supp
Options for the internal markdown-it plugin for generating markdown headings and heading anchors.
|Property|Type|Default|Description|
|---|---|---|---|
|`injectMarkdownHeadings`|`boolean`|`true`|Inject markdown headings as `page.markdownHeadings`|
|`permalink`|`boolean`|`false`|Generating permalinks.|
|`permalinkComponent`|`string`|`saber-link`||
|`permalinkBefore`|`bolean`|`true`|Inject permalink before heading text.|
|`permalinkSymbol`|`string`|`#`|The permalink symbol.|
| Property | Type | Default | Description |
| ------------------------ | --------- | ------------ | --------------------------------------------------- |
| `injectMarkdownHeadings` | `boolean` | `true` | Inject markdown headings as `page.markdownHeadings` |
| `permalink` | `boolean` | `false` | Generating permalinks. |
| `permalinkComponent` | `string` | `saber-link` | |
| `permalinkBefore` | `bolean` | `true` | Inject permalink before heading text. |
| `permalinkSymbol` | `string` | `#` | The permalink symbol. |
### options
Expand Down

0 comments on commit 1bcfd21

Please sign in to comment.