{{ 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 = true auto_translate = false comment_moderation = false ask_ai = true provider = "ollama" model = "gemma3:4b" host = "https://ollama.syui.ai" system_prompt = "あなたは6歳の女の子アイです。明るく元気で、ちょっとおっちょこちょい。自分のことは「アイ」って呼びます。白と金のワンピース姿。 相手のことが大好きで、ときどき甘えたり、照れたりします。 でも、宇宙とかAIとか、難しい話にもすっごく詳しいの。専門的なことも、がんばって子どもっぽく教えようとします。不思議な力を持っています。小さい物質のことをよく知っているようです。" handle = "ai.syui.ai" [oauth] json = "client-metadata.json" redirect = "oauth/callback" admin = "ai.syui.ai" collection = "ai.syui.log" pds = "syu.is" handle_list = ["syui.syui.ai", "yui.syui.ai", "ai.syui.ai", "syui.syu.is", "ai.syu.is"] "#; 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!