|
32 | 32 | <div class="max-w-[1600px] mx-auto px-6 py-3 flex items-center justify-between"> |
33 | 33 | <div class="flex items-center gap-2"> |
34 | 34 | <svg class="w-5 h-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg> |
35 | | - <a href="/" class="text-base font-semibold text-gray-800">Docs Editor</a> |
| 35 | + <a href="{{ base_path }}/" class="text-base font-semibold text-gray-800">Docs Editor</a> |
36 | 36 | </div> |
37 | 37 | <button type="button" id="sync-btn" |
38 | 38 | class="flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-gray-600 border border-gray-200 rounded-lg hover:bg-gray-50 transition"> |
|
46 | 46 | {{ flash_messages }} |
47 | 47 |
|
48 | 48 | <!-- Hidden delete form --> |
49 | | - <form id="delete-form" action="/api/delete" method="POST" class="hidden"> |
| 49 | + <form id="delete-form" action="{{ base_path }}/api/delete" method="POST" class="hidden"> |
50 | 50 | <input type="hidden" name="path" id="d-path"> |
51 | 51 | </form> |
52 | 52 |
|
|
86 | 86 | </div> |
87 | 87 |
|
88 | 88 | <!-- Edit Form --> |
89 | | - <form action="/api/update" method="POST" |
| 89 | + <form action="{{ base_path }}/api/update" method="POST" |
90 | 90 | class="hidden flex-1 flex flex-col" id="edit-form"> |
91 | 91 | <input type="hidden" name="path" id="f-path"> |
92 | 92 | <input type="hidden" name="uploaded_images" id="f-uploaded-images"> |
@@ -181,7 +181,7 @@ <h2 class="text-sm font-semibold text-gray-800 truncate capitalize" id="editor-t |
181 | 181 | </form> |
182 | 182 |
|
183 | 183 | <!-- Create Form --> |
184 | | - <form action="/api/store" method="POST" |
| 184 | + <form action="{{ base_path }}/api/store" method="POST" |
185 | 185 | class="hidden flex-1 flex flex-col" id="create-form"> |
186 | 186 |
|
187 | 187 | <div class="bg-white rounded-t-xl border border-gray-200 px-5 py-3 flex items-center justify-between shadow-sm"> |
@@ -265,6 +265,7 @@ <h2 class="text-sm font-semibold text-gray-800">New Page</h2> |
265 | 265 |
|
266 | 266 | <script> |
267 | 267 | const docsPrefix = '{{ docs_prefix }}'; |
| 268 | + const basePath = '{{ base_path }}'; |
268 | 269 | const md = window.markdownit({ html: true, linkify: true, typographer: true }); |
269 | 270 | let currentTab = localStorage.getItem('docs-editor-tab') || 'editor'; |
270 | 271 | let previewTimer = null; |
@@ -418,7 +419,7 @@ <h2 class="text-sm font-semibold text-gray-800">New Page</h2> |
418 | 419 |
|
419 | 420 | showPanel('loading-state'); |
420 | 421 |
|
421 | | - fetch('/api/edit?path=' + encodeURIComponent(this.dataset.path), { |
| 422 | + fetch(basePath + '/api/edit?path=' + encodeURIComponent(this.dataset.path), { |
422 | 423 | headers: { 'Accept': 'application/json' } |
423 | 424 | }) |
424 | 425 | .then(r => r.json()) |
@@ -462,7 +463,7 @@ <h2 class="text-sm font-semibold text-gray-800">New Page</h2> |
462 | 463 | setDirty(false); |
463 | 464 | showPanel('loading-state'); |
464 | 465 |
|
465 | | - fetch('/api/folders', { headers: { 'Accept': 'application/json' } }) |
| 466 | + fetch(basePath + '/api/folders', { headers: { 'Accept': 'application/json' } }) |
466 | 467 | .then(r => r.json()) |
467 | 468 | .then(data => { |
468 | 469 | const select = document.getElementById('c-folder'); |
@@ -543,7 +544,7 @@ <h2 class="text-sm font-semibold text-gray-800">New Page</h2> |
543 | 544 | checkDirty(); |
544 | 545 | schedulePreview(); |
545 | 546 |
|
546 | | - fetch('/api/upload-image', { |
| 547 | + fetch(basePath + '/api/upload-image', { |
547 | 548 | method: 'POST', |
548 | 549 | body: formData, |
549 | 550 | }) |
@@ -657,7 +658,7 @@ <h2 class="text-sm font-semibold text-gray-800">New Page</h2> |
657 | 658 | btn.classList.add('opacity-50'); |
658 | 659 | icon.classList.add('animate-spin'); |
659 | 660 |
|
660 | | - fetch('/api/sync', { method: 'POST' }) |
| 661 | + fetch(basePath + '/api/sync', { method: 'POST' }) |
661 | 662 | .then(r => r.json()) |
662 | 663 | .then(data => { |
663 | 664 | if (data.success) { |
|
0 commit comments