@@ -2,27 +2,24 @@ import { Application } from "@focal/cross";
22import { HttpContext } from "@focal/cross/context" ;
33import { Cross } from "@focal/cross/decorators" ;
44import { getDocument , getReadme , getSummary , meta } from "./docs.ts" ;
5+ import { tmpl } from "./tmpl.ts" ;
56
67@Cross
78export default class {
89
910 constructor ( app : Application ) {
1011 const { engine } = app ;
11- const tmplUrl = new URL ( import . meta. resolve ( './tmpl.html' ) ) ;
12-
13- console . log ( tmplUrl )
14- const tmplText = Deno . readTextFileSync ( tmplUrl ) ;
1512
1613 app . get ( "/" , async ( ) => {
1714 const summary = await getSummary ( ) ;
1815 const content = await getReadme ( ) ;
19- return engine . render ( tmplText , { meta, summary, content } ) ;
16+ return engine . render ( tmpl , { meta, summary, content } ) ;
2017 } ) ;
2118
2219 app . get ( "/*" , async ( ctx : HttpContext ) => {
2320 const summary = await getSummary ( ) ;
2421 const content = await getDocument ( ctx . request . pathname ) ;
25- return engine . render ( tmplText , { meta, summary, content } ) ;
22+ return engine . render ( tmpl , { meta, summary, content } ) ;
2623 } ) ;
2724
2825 app . run ( ) ;
0 commit comments