Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/cmd/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const MD_MAIN_JS: &str = include_str!("../static/md-templates/main.js");
const MD_SLIDES: &str = include_str!("../static/md-templates/slides.md");
const MD_CUSTOM_CSS: &str = include_str!("../static/md-templates/custom.css");
const MD_FERRIS: &[u8] = include_bytes!("../static/md-templates/ferris.png");

const MD_GITIGNORE: &str = include_str!("../static/md-templates/.gitignore");
const MD_FAVICON: &[u8] = include_bytes!("../static/md-templates/favicon.png");

// do the same with the html templates
const HTML_VITE_CONFIG_JS: &str = include_str!("../static/html-templates/vite.config.js");
Expand All @@ -59,6 +59,8 @@ const HTML_SLIDES: &str = include_str!("../static/html-templates/slides.html");
const HTML_CUSTOM_CSS: &str = include_str!("../static/html-templates/custom.css");
const HTML_FERRIS: &[u8] = include_bytes!("../static/html-templates/ferris.png");
const HTML_GITIGNORE: &str = include_str!("../static/html-templates/.gitignore");
const HTML_FAVICON: &[u8] = include_bytes!("../static/html-templates/favicon.png");


/// Initialize an Oseda project with the provided options
///
Expand Down Expand Up @@ -150,6 +152,8 @@ pub fn init(opts: InitOptions) -> Result<(), Box<dyn Error>> {

std::fs::create_dir_all(format!("{}/public", &conf.title))?;
fs::write(format!("{}/public/ferris.png", &conf.title), MD_FERRIS)?;
fs::write(format!("{}/public/favicon.png", &conf.title), MD_FAVICON)?;

}
Template::HTML => {
// fs::write(format!("{}/package.json", &conf.title), HTML_PACKAGE_JSON)?;
Expand All @@ -170,7 +174,9 @@ pub fn init(opts: InitOptions) -> Result<(), Box<dyn Error>> {
fs::write(format!("{}/css/custom.css", &conf.title), HTML_CUSTOM_CSS)?;

std::fs::create_dir_all(format!("{}/public", &conf.title))?;
fs::write(format!("{}/public/ferris.png", &conf.title), HTML_FERRIS)?
fs::write(format!("{}/public/ferris.png", &conf.title), HTML_FERRIS)?;
fs::write(format!("{}/public/favicon.png", &conf.title), HTML_FAVICON)?;

}
}

Expand Down
Binary file added src/static/html-templates/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/static/html-templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Reveal + Vite</title>
<title>My OSEDA project</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="/favicon.png" />
</head>
<body>
<div class="reveal">
Expand Down
Binary file added src/static/md-templates/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/static/md-templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Reveal + Vite</title>
<title>My OSEDA project</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="/favicon.png" />
</head>
<body>
<div class="reveal">
Expand Down
Loading