Skip to content

Commit

Permalink
Merge pull request #189 from garikAsplund/unwrap-base-url
Browse files Browse the repository at this point in the history
Unwrap base URL and minor styling
  • Loading branch information
itowlson authored May 5, 2024
2 parents 9da8a68 + 36df135 commit d85b5e5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/bartholomew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ pub fn render(req: Request) -> Result<Response> {
if let Ok(url) = base_url {
config.base_url = Some(url);
}
eprintln!("Base URL: {:?}", &config.base_url);
eprintln!("Prepend route info : {:?}", &config.prepend_route_info);

if let Some(url) = &config.base_url {
eprintln!("Base URL: {}", url);
};
eprintln!("Prepend route info: {:?}", &config.prepend_route_info);

if config.prepend_route_info {
let route_info = match req.headers().get("spin-component-route") {
Expand All @@ -61,7 +64,7 @@ pub fn render(req: Request) -> Result<Response> {
eprintln!("Updated request path: {:?}", path_info);
}

// If a theme is specifed, create theme path
// If a theme is specified, create theme path
let theme_dir = if config.theme.is_some() {
let mut path: PathBuf = PathBuf::from(THEME_PATH);
path.push(config.theme.as_ref().unwrap());
Expand Down Expand Up @@ -92,7 +95,7 @@ pub fn render(req: Request) -> Result<Response> {
// Load the content.
let content_path = content::content_path(PathBuf::from(CONTENT_PATH), &path_info);

eprintln!("Path {}", content_path.to_string_lossy());
eprintln!("Path: {}", content_path.to_string_lossy());

match std::fs::read_to_string(&content_path) {
Ok(full_document) => {
Expand Down

0 comments on commit d85b5e5

Please sign in to comment.