mirror of
https://github.com/StepanovPlaton/AboutMe.git
synced 2026-04-03 12:20:48 +04:00
Fixes
This commit is contained in:
@@ -19,12 +19,12 @@ function detectPlatform() {
|
|||||||
if (process.env.GITHUB_ACTIONS) {
|
if (process.env.GITHUB_ACTIONS) {
|
||||||
return 'github';
|
return 'github';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if specific directories exist
|
// Check if specific directories exist
|
||||||
if (existsSync('.vercel')) {
|
if (existsSync('.vercel')) {
|
||||||
return 'vercel';
|
return 'vercel';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default to standard dist directory
|
// Default to standard dist directory
|
||||||
return 'default';
|
return 'default';
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,7 @@ function getPagefindOutputDir(platform) {
|
|||||||
github: 'dist',
|
github: 'dist',
|
||||||
default: 'dist'
|
default: 'dist'
|
||||||
};
|
};
|
||||||
|
|
||||||
return outputDirs[platform] || 'dist';
|
return outputDirs[platform] || 'dist';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,34 +46,34 @@ function getPagefindOutputDir(platform) {
|
|||||||
function main() {
|
function main() {
|
||||||
const platform = detectPlatform();
|
const platform = detectPlatform();
|
||||||
const outputDir = getPagefindOutputDir(platform);
|
const outputDir = getPagefindOutputDir(platform);
|
||||||
|
|
||||||
console.log(`🚀 Detected deployment platform: ${platform}`);
|
console.log(`🚀 Detected deployment platform: ${platform}`);
|
||||||
console.log(`📁 Pagefind output directory: ${outputDir}`);
|
console.log(`📁 Pagefind output directory: ${outputDir}`);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Run Astro build
|
// Run Astro build
|
||||||
console.log('🔨 Running Astro build...');
|
console.log('🔨 Running Astro build...');
|
||||||
execSync(`npx astro build`.trim(), {
|
execSync(`npx astro build`.trim(), {
|
||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
cwd: process.cwd() // Ensure in the correct directory
|
cwd: process.cwd() // Ensure in the correct directory
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check if output directory exists
|
// Check if output directory exists
|
||||||
if (!existsSync(outputDir)) {
|
if (!existsSync(outputDir)) {
|
||||||
console.error(`❌ Output directory does not exist: ${outputDir}`);
|
console.error(`❌ Output directory does not exist: ${outputDir}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run Pagefind
|
// Run Pagefind
|
||||||
console.log(`🔍 Running Pagefind search index generation...`);
|
console.log(`🔍 Running Pagefind search index generation...`);
|
||||||
execSync(`npx pagefind --site ${outputDir}`, {
|
execSync(`npx pagefind --site ${outputDir}`, {
|
||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
cwd: process.cwd() // Ensure in the correct directory
|
cwd: process.cwd() // Ensure in the correct directory
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('✅ Build completed!');
|
console.log('✅ Build completed!');
|
||||||
console.log(`📊 Search index generated at: ${outputDir}/pagefind/`);
|
console.log(`📊 Search index generated at: ${outputDir}/pagefind/`);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('❌ Build failed:', error.message);
|
console.error('❌ Build failed:', error.message);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|||||||
@@ -51,11 +51,11 @@ let links: NavbarLink[] = navbarConfig.links.map(
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center navbar-buttons" id="navbar-buttons">
|
<div class="flex items-center navbar-buttons" id="navbar-buttons">
|
||||||
<Search client:load></Search>
|
<!-- <Search client:load></Search> -->
|
||||||
<Translator client:load></Translator>
|
<Translator client:load></Translator>
|
||||||
<!-- <DisplaySettings client:load></DisplaySettings> -->
|
<!-- <DisplaySettings client:load></DisplaySettings> -->
|
||||||
<!-- <LightDarkSwitch client:load></LightDarkSwitch> -->
|
<LightDarkSwitch client:load></LightDarkSwitch>
|
||||||
<WallpaperSwitch client:load></WallpaperSwitch>
|
<!-- <WallpaperSwitch client:load></WallpaperSwitch> -->
|
||||||
<NavMenu client:load links={links}></NavMenu>
|
<NavMenu client:load links={links}></NavMenu>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user