Fix the links to the blog posts.

This commit is contained in:
Tom Alexander
2023-12-19 16:46:32 -05:00
parent add267d616
commit 261fe8a1a2
5 changed files with 14 additions and 7 deletions

View File

@@ -57,6 +57,15 @@ impl Config {
self.get_root_directory().join("posts")
}
/// Get the relative path to the folder containing a blog post.
///
/// This could be appended to the output root directory to get the
/// blog post output folder or it could be used to generate a link
/// to the blog post.
pub(crate) fn get_relative_path_to_post<P: AsRef<Path>>(&self, post_id: P) -> PathBuf {
Path::new("posts").join(post_id)
}
pub(crate) fn get_output_directory(&self) -> PathBuf {
self.get_root_directory().join("output")
}