Skip to content

Commit

Permalink
Clean: remove old params and bump version.
Browse files Browse the repository at this point in the history
  • Loading branch information
teesloane committed Mar 29, 2022
1 parent 70983ed commit 5524c09
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl BaseUrl {
.to_path_buf()
}

pub fn build(self, link: String, file_path: PathBuf, _parents_to_drop: i32) -> String {
pub fn build(self, link: String, file_path: PathBuf) -> String {
let mut parent_dirs = self.strip_source_cwd(file_path.clone());
// start with just the baseurl.
let mut link_res = PathBuf::from(self.base_url.clone());
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use clap::{Parser, Subcommand};

/// Org Mode static site generator
#[derive(Parser)]
#[clap(name = "Firn", version = "0.15", author = "The Ice Shelf")]
#[clap(name = "Firn", version = "0.21", author = "The Ice Shelf")]
struct Cli {
/// Set the level of verbosity, e.g. -v => verbose, -vv => very verbose
#[clap(short, long, global = true, parse(from_occurrences))]
Expand Down
2 changes: 1 addition & 1 deletion src/org.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl<'a> OrgFile<'a> {
.into_os_string()
.into_string()
.expect("Failed to convert web_path to string");
let full_url = cfg.base_url.clone().build(web_path_str, file_path.clone(), 0);
let full_url = cfg.base_url.clone().build(web_path_str, file_path.clone());
let out_path = PathBuf::from(&cfg.dir_site_out).join(&web_path);
let parsed = Org::parse_string(read_file);
let front_matter = FrontMatter::new(&parsed);
Expand Down
6 changes: 2 additions & 4 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ pub fn transform_org_link_to_html(
org_link_path: String,
file_path: PathBuf,
) -> String {
let num_parents = 0;

let mut link_path = org_link_path;

// -- handle different types of links.
Expand All @@ -41,13 +39,13 @@ pub fn transform_org_link_to_html(
// link_path = clean_file_link(link_path);
link_path = str::replace(&link_path, ".org", ".html");
link_path = str::replace(&link_path, "file:", "");
let x = base_url.build(link_path, file_path, num_parents);
let x = base_url.build(link_path, file_path);
return x

// <2> it's a local image
} else if is_local_img_file(&link_path) {
link_path = str::replace(&link_path, "file:", "");
return base_url.build(link_path, file_path, num_parents);
return base_url.build(link_path, file_path);
}

// <3> is a web link (doesn't start with baseurl.)
Expand Down

0 comments on commit 5524c09

Please sign in to comment.