fixes frontend getting resources from backend
This commit is contained in:
@@ -28,7 +28,11 @@ use std::{
|
||||
use gix::open;
|
||||
use tera::Tera;
|
||||
|
||||
use crate::backend::git::ToContext;
|
||||
use crate::backend::{
|
||||
MINTEE_DIR,
|
||||
MINTEE_ASSETS,
|
||||
git::ToContext,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
/// A revision for which a repository page may be rendered
|
||||
@@ -134,9 +138,8 @@ impl Page {
|
||||
pub fn render<W: Write>(
|
||||
&self, dest: &mut W
|
||||
) -> Result<(), Box<dyn Error>> {
|
||||
/* TODO: replace ./assets/ with the actual templates directory,
|
||||
* i.e. /usr/local/share/mintee/ */
|
||||
let tera = Tera::new("./assets/templates/**/*")?;
|
||||
let assets = format!("{}/templates/**/*", MINTEE_ASSETS);
|
||||
let tera = Tera::new(&assets)?;
|
||||
let mut page_template = self.kind.to_string();
|
||||
|
||||
use PageKind::*;
|
||||
@@ -145,7 +148,11 @@ impl Page {
|
||||
todo!()
|
||||
},
|
||||
Repo(r) => {
|
||||
let repo = open(format!("{}/{}", r.entity, r.name))?;
|
||||
|
||||
let mut repo_path = PathBuf::from(MINTEE_DIR.to_string());
|
||||
repo_path.push(r.entity);
|
||||
repo_path.push(r.name);
|
||||
let repo = open(repo_path)?;
|
||||
/* TODO: handle specifying a commit, tag, or branch */
|
||||
let head_tree = repo.head_tree()?;
|
||||
let object;
|
||||
|
||||
Reference in New Issue
Block a user