Store the path to the original source file in the blog post object.
This commit is contained in:
@@ -13,6 +13,9 @@ pub(crate) struct IPage {
|
||||
/// Relative path from the root of the pages directory.
|
||||
pub(crate) path: PathBuf,
|
||||
|
||||
/// The path to the .org source for the file.
|
||||
pub(crate) src: PathBuf,
|
||||
|
||||
pub(crate) title: Option<String>,
|
||||
|
||||
#[allow(dead_code)]
|
||||
@@ -61,6 +64,7 @@ intermediate!(
|
||||
|
||||
Ok(IPage {
|
||||
path: original.path,
|
||||
src: original.src,
|
||||
title: get_title(original.document),
|
||||
date: get_date(original.document),
|
||||
children,
|
||||
@@ -80,17 +84,23 @@ impl IPage {
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct PageInput<'b, 'parse> {
|
||||
/// Relative path from the root of the page.
|
||||
path: PathBuf,
|
||||
|
||||
/// The path to the .org source for the file.
|
||||
src: PathBuf,
|
||||
document: &'b organic::types::Document<'parse>,
|
||||
}
|
||||
|
||||
impl<'b, 'parse> PageInput<'b, 'parse> {
|
||||
pub(crate) fn new<P: Into<PathBuf>>(
|
||||
pub(crate) fn new<P: Into<PathBuf>, S: Into<PathBuf>>(
|
||||
path: P,
|
||||
src: S,
|
||||
document: &'b organic::types::Document<'parse>,
|
||||
) -> PageInput<'b, 'parse> {
|
||||
PageInput {
|
||||
path: path.into(),
|
||||
src: src.into(),
|
||||
document,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user