Skip to content

Commit 4f572e6

Browse files
committed
Use baseurl in add_content.
1 parent e090671 commit 4f572e6

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

defaults/core/cms/add_content.svelte

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
import ButtonWrapper from './button_wrapper.svelte';
44
import validateFilename from './validate_filename.js';
55
6-
export let showAdd, showEditor;
6+
export let showAdd, showEditor, env;
77
let filename = "";
8+
let baseurl = env.baseurl ? env.baseurl : '/';
89
910
let selectedType;
1011
const setType = type => {
@@ -16,7 +17,7 @@
1617
validationErrors = validateFilename(filename, selectedType);
1718
// No errors, redirect to "add" page
1819
if (validationErrors.length === 0) {
19-
redirectAndEdit('/#add/' + selectedType + '/' + filename);
20+
redirectAndEdit(baseurl + '#add/' + selectedType + '/' + filename);
2021
}
2122
}
2223

defaults/core/cms/admin_menu.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
</svg>
153153
</div>
154154
<div class="modal small" on:click|stopPropagation>
155-
<AddContent bind:showAdd bind:showEditor />
155+
<AddContent bind:showAdd bind:showEditor {env} />
156156
</div>
157157
</div>
158158

defaults/core/router.svelte

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
* @return {boolean} true if hash location found and navigated, false otherwise.
6767
*/
6868
const navigateHashLocation = () => {
69-
if (location.pathname != '/') {
69+
let baseurl = env.baseurl ? env.baseurl : '/';
70+
if (location.pathname !== baseurl) {
7071
return false;
7172
}
7273

0 commit comments

Comments
 (0)