{{ post.title }}
{% if post.excerpt %}{{ post.excerpt }}
{% endif %}use anyhow::Result; use colored::Colorize; use std::fs; use std::path::PathBuf; pub async fn execute(path: PathBuf) -> Result<()> { println!("{}", "Initializing new blog...".green()); // Create directory structure let dirs = vec![ "content", "content/posts", "templates", "static", "static/css", "static/js", "static/images", "public", ]; for dir in dirs { let dir_path = path.join(dir); fs::create_dir_all(&dir_path)?; println!(" {} {}", "Created".cyan(), dir_path.display()); } // Create default config let config_content = r#"[site] title = "My Blog" description = "A blog powered by ailog" base_url = "https://example.com" language = "ja" author = "Your Name" [build] highlight_code = true minify = false [ai] enabled = false auto_translate = false comment_moderation = false "#; fs::write(path.join("config.toml"), config_content)?; println!(" {} config.toml", "Created".cyan()); // Create modern template let base_template = r#"
{{ post.excerpt }}
{% endif %}No posts yet. Start writing!