fix
This commit is contained in:
23
src/build.rs
23
src/build.rs
@@ -67,8 +67,17 @@ pub async fn execute() -> Result<()> {
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Blog Posts</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; max-width: 800px; margin: 0 auto; padding: 2rem; }
|
||||
.nav { margin-bottom: 2rem; padding: 1rem; background: #f5f5f5; border-radius: 4px; }
|
||||
.nav a { margin-right: 1rem; color: #0066cc; text-decoration: none; }
|
||||
.nav a:hover { text-decoration: underline; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="nav">
|
||||
<a href="/pds/">🔍 PDS Browser</a>
|
||||
</div>
|
||||
<h1>Posts</h1>
|
||||
<ul>
|
||||
"#,
|
||||
@@ -122,18 +131,18 @@ pub async fn execute() -> Result<()> {
|
||||
|
||||
println!("\nDone! Site generated in ./public/");
|
||||
println!(" - Blog: ./public/index.html");
|
||||
println!(" - AT Browser: ./public/at/index.html");
|
||||
println!(" - PDS Browser: ./public/pds/index.html");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn build_browser() -> Result<()> {
|
||||
use std::process::Command;
|
||||
|
||||
let browser_dir = "./browser";
|
||||
let browser_dir = "./repos/log/pds";
|
||||
|
||||
// Check if browser directory exists
|
||||
// Check if pds directory exists
|
||||
if !std::path::Path::new(browser_dir).exists() {
|
||||
println!(" ⚠ Browser directory not found, skipping");
|
||||
println!(" ⚠ PDS directory not found, skipping");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@@ -164,14 +173,14 @@ async fn build_browser() -> Result<()> {
|
||||
anyhow::bail!("npm run build failed");
|
||||
}
|
||||
|
||||
// Copy dist to public/at
|
||||
// Copy dist to public/pds
|
||||
let dist_dir = format!("{}/dist", browser_dir);
|
||||
let target_dir = "./public/at";
|
||||
let target_dir = "./public/pds";
|
||||
|
||||
if std::path::Path::new(&dist_dir).exists() {
|
||||
fs::create_dir_all(target_dir)?;
|
||||
copy_dir_all(&dist_dir, target_dir)?;
|
||||
println!(" ✓ Browser app deployed to ./public/at/");
|
||||
println!(" ✓ PDS browser deployed to ./public/pds/");
|
||||
} else {
|
||||
println!(" ⚠ dist directory not found");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user