//! atproto-static-web   A simple web viewer for AT Proto.
//! Copyright (C) 2025  AverageHelper
//!
//! This program is free software: you can redistribute it and/or modify
//! it under the terms of the GNU General Public License as published by
//! the Free Software Foundation, either version 3 of the License, or
//! (at your option) any later version.
//!
//! This program is distributed in the hope that it will be useful,
//! but WITHOUT ANY WARRANTY; without even the implied warranty of
//! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//! GNU General Public License for more details.
//!
//! You should have received a copy of the GNU General Public License
//! along with this program.  If not, see <https://www.gnu.org/licenses/>.

use crate::{
	env::Env,
	server::lang::{Lang, tr},
	templates,
};
use maud::{Markup, html};

pub fn index(lang: Lang, env: &Env) -> Markup {
	let meta = templates::base::Meta {
		title: env.site_name(),
		lang,
		content_locales: &[oxilangtag::LanguageTag::parse(lang.to_string()).unwrap()],
		og_type: templates::base::OgType::Website,
		profile_username: None,
		og_published_time: None,
		og_title: env.site_name(),
		canonical_url: env.base_url(),
		og_description: tr!(lang, "index.tagline"),
		og_images: &[],
		og_videos: None,
		og_card: templates::base::OgCard::Summary,
		labels: &[],
	};
	let main = html! {
		p { (tr!(lang, "index.content")) }
	};

	templates::base::base(env, meta, main)
}
