fix(demo): use relative paths for GitHub Pages and code.soulcraft hosting environments
- Updated script to use consistent relative paths for compatibility across hosting setups. - Removed absolute path for code.soulcraft.com to ensure seamless local and hosted deployments.
This commit is contained in:
parent
23e50b09bf
commit
887a08b689
1 changed files with 8 additions and 7 deletions
|
|
@ -1254,17 +1254,18 @@ await db.init()
|
||||||
<script type="module">
|
<script type="module">
|
||||||
// Always use local files instead of CDN
|
// Always use local files instead of CDN
|
||||||
// Use relative path for GitHub Pages compatibility
|
// Use relative path for GitHub Pages compatibility
|
||||||
const isGitHubPages = window.location.hostname.includes('github.io');
|
const isGitHubPages = window.location.hostname.includes('github.io')
|
||||||
const isCodeSoulcraft = window.location.hostname.includes('code.soulcraft.com');
|
const isCodeSoulcraft = window.location.hostname.includes('code.soulcraft.com')
|
||||||
|
|
||||||
// Use different paths based on hosting environment
|
// Use different paths based on hosting environment
|
||||||
let importPath;
|
let importPath
|
||||||
if (isGitHubPages) {
|
if (isGitHubPages) {
|
||||||
importPath = './dist/unified.js'; // Direct access to dist folder in demo directory
|
importPath = './dist/unified.js' // Direct access to dist folder in demo directory
|
||||||
} else if (isCodeSoulcraft) {
|
} else if (isCodeSoulcraft) {
|
||||||
importPath = '/brainy/dist/unified.js'; // Absolute path for code.soulcraft.com
|
// Use relative path instead of absolute path for code.soulcraft.com
|
||||||
|
importPath = './dist/unified.js'
|
||||||
} else {
|
} else {
|
||||||
importPath = '/dist/unified.js'; // Local development
|
importPath = '/dist/unified.js' // Local development
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dynamic import
|
// Dynamic import
|
||||||
|
|
@ -2432,7 +2433,7 @@ await db.init()
|
||||||
case 'verbs':
|
case 'verbs':
|
||||||
// Search for verbs directly
|
// Search for verbs directly
|
||||||
results = await database.search(query, 10, {
|
results = await database.search(query, 10, {
|
||||||
searchVerbs: true,
|
searchVerbs: true
|
||||||
// Optionally filter by verb types
|
// Optionally filter by verb types
|
||||||
// verbTypes: ['RelatedTo', 'Created', 'Owns']
|
// verbTypes: ['RelatedTo', 'Created', 'Owns']
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue