oranda 0.6.5

🎁 generate beautiful landing pages for your projects
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use axoasset::LocalAsset;
use camino::Utf8Path;

use crate::errors::*;
use crate::site::link;

pub mod analytics;

const ARTIFACTS_SCRIPT_SOURCE: &str = include_str!("./artifacts.js");

pub fn build_os_script_path(path_prefix: &Option<String>) -> String {
    link::generate_relative(path_prefix, "artifacts.js")
}

pub fn write_os_script(dist_dir: &Utf8Path) -> Result<()> {
    LocalAsset::write_new(ARTIFACTS_SCRIPT_SOURCE, dist_dir.join("artifacts.js"))?;
    Ok(())
}